el_makong Posted November 12, 2015 Share Posted November 12, 2015 how do i check for whmcs version in my addon module? for example: if module activated, it check whmcs version at least version 6.0. if lower than 6.0, module cannot be activated.(my module require pdo functions to work) if equal or higher, module activated. note: it do check whmcs version. not module version(like the upgrade function). 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted November 12, 2015 Share Posted November 12, 2015 the following give you version of WHMCS $CONFIG['Version'] but keep in mind that sometimes version number may look like that: 6.1.1-release.1 0 Quote Link to comment Share on other sites More sharing options...
el_makong Posted November 12, 2015 Author Share Posted November 12, 2015 the $CONFIG['Version'] returns nothing. in my code, for example: function mymodule_test($vars){ echo $CONFIG['Version']; } but if : function mymodule_test($vars){ echo $vars['version']; } it returns the module's version. not whmcs's as the formatting, i could use version_compare($whmcsversion<$requiredversion) so no problem there. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted November 12, 2015 Share Posted November 12, 2015 it should be used like that function name($vars){ global $CONFIG; echo $CONFIG['Version']; } 0 Quote Link to comment Share on other sites More sharing options...
el_makong Posted November 12, 2015 Author Share Posted November 12, 2015 it should be used like that function name($vars){ global $CONFIG; echo $CONFIG['Version']; } now thats works.thanks. so i need to call the global variable 1st then use it. the thread can now marked as solved. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.