I trying to use function ioncube_license_properties()
to get encoded property at my project. But I have a trouble - function return false
at class method and return actual value at procedure file.
I have next code. Class:
class User {
/**
* Check is can login with new user.
* @return bool
*/
public static function validateLicense()
{
if (function_exists('ioncube_license_properties')) {
$count = ioncube_license_properties()['allowedUserCount']['value']; // ioncube_license_properties() returns false there
if ($count === 10) {
//info($message . 'User can login.');
} else {
//warning($message . 'Access denied for.');
}
return $isCanLogin;
} else {
//warning('Can\'t find Ioncube function `ioncube_license_properties()`.');
return true;
}
}
}
simple php file (it's a view file on MVC model):
if(function_exists('ioncube_license_properties')) {
var_dump(['validateLicense' => User::validateLicense()]); // false always
var_dump(['$allowedUserCount' => $allowedUserCount = ioncube_license_properties()['allowedUserCount']['value']]); // returns actual value int(10)
}
Why function returns incorrect value at the class method and how to fix this?
Project use Yii2.