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 d523e63..d76b3d2 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 aebadcc..e1c7cb9 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.');
         }