Use of the FrameworkFeature class (which is a manager somehow) +
authorRoland Haeder <roland@mxchange.org>
Wed, 27 May 2015 01:32:23 +0000 (03:32 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 May 2015 01:32:23 +0000 (03:32 +0200)
__callStatic() is now more verbose if NULL or an empty string was used.

Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/scrypt/class_Scrypt.php

index d523e639f4ca8af2738eaff56989cb9dbb7c136d..d76b3d2ec40d4ff71a5f7e9c1809095b315ced3c 100644 (file)
@@ -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) {
index aebadcc79c74497ba3fcc0bd9acbd6af6e39e242..e1c7cb9c307abca6b73289c6d52c3a937de527f6 100644 (file)
@@ -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.');
         }