From 0ccdb0379f308c6b7b5677b8b7c242df8e9dd300 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 27 May 2015 03:32:23 +0200 Subject: [PATCH] Use of the FrameworkFeature class (which is a manager somehow) + __callStatic() is now more verbose if NULL or an empty string was used. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/class_BaseFrameworkSystem.php | 7 +++++-- inc/classes/main/scrypt/class_Scrypt.php | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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.'); } -- 2.39.2