From: Roland Haeder Date: Wed, 27 May 2015 01:32:23 +0000 (+0200) Subject: Use of the FrameworkFeature class (which is a manager somehow) + X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=0ccdb0379f308c6b7b5677b8b7c242df8e9dd300 Use of the FrameworkFeature class (which is a manager somehow) + __callStatic() is now more verbose if NULL or an empty string was used. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index d523e639..d76b3d2e 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -475,10 +475,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Init argument string $argsString = ''; - // Is it empty or an array? - if (empty($args)) { + // Is it NULL, empty or an array? + if (is_null($args)) { // No arguments $argsString = 'NULL'; + } elseif (empty($args)) { + // Empty arguments + $argsString = '(empty)'; } elseif (is_array($args)) { // Some arguments are there foreach ($args as $arg) { diff --git a/inc/classes/main/scrypt/class_Scrypt.php b/inc/classes/main/scrypt/class_Scrypt.php index aebadcc7..e1c7cb9c 100644 --- a/inc/classes/main/scrypt/class_Scrypt.php +++ b/inc/classes/main/scrypt/class_Scrypt.php @@ -130,7 +130,7 @@ abstract class Scrypt extends BaseFrameworkSystem */ public static function hashScrypt ($password, $salt = false, $N = 16384, $r = 8, $p = 1) { - if ((!FrameworkConfiguration::getSelfInstance()->isConfigurationEntrySet('extension_scrypt_loaded')) || (FrameworkConfiguration::getSelfInstance()->getConfigEntry('extension_scrypt_loaded') === FALSE)) { + if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) { // Feature has been disabled throw new \InvalidArgumentException('Feature "scrypt" disabled.'); } @@ -174,7 +174,7 @@ abstract class Scrypt extends BaseFrameworkSystem return false; } - if ((!FrameworkConfiguration::getSelfInstance()->isConfigurationEntrySet('extension_scrypt_loaded')) || (FrameworkConfiguration::getSelfInstance()->getConfigEntry('extension_scrypt_loaded') === FALSE)) { + if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) { // Feature has been disabled throw new \InvalidArgumentException('Feature "scrypt" disabled.'); }