Use of the FrameworkFeature class (which is a manager somehow) +
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index f4d7d6787493e73a85994085cf1010ece226cc56..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) {
@@ -1891,12 +1894,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $str            The string, what ever it is needs to be converted
         * @return      $className      Generated class name
         */
-       public function convertToClassName ($str) {
+       public static final function convertToClassName ($str) {
                // Init class name
                $className = '';
 
                // Convert all dashes in underscores
-               $str = $this->convertDashesToUnderscores($str);
+               $str = self::convertDashesToUnderscores($str);
 
                // Now use that underscores to get classname parts for hungarian style
                foreach (explode('_', $str) as $strPart) {
@@ -1914,7 +1917,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $str    The string with maybe dashes inside
         * @return      $str    The converted string with no dashed, but underscores
         */
-       public final function convertDashesToUnderscores ($str) {
+       public static final function convertDashesToUnderscores ($str) {
                // Convert them all
                $str = str_replace('-', '_', $str);
 
@@ -2084,7 +2087,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, TRUE).'</pre>');
 
                // Convert dashes to underscore
-               $fieldName2 = $this->convertDashesToUnderscores($fieldName);
+               $fieldName2 = self::convertDashesToUnderscores($fieldName);
 
                // Does the field exist?
                if ($this->isFieldSet($fieldName)) {
@@ -2124,7 +2127,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, TRUE).'</pre>');
 
                // Convert dashes to underscore
-               $fieldName = $this->convertDashesToUnderscores($fieldName);
+               $fieldName = self::convertDashesToUnderscores($fieldName);
 
                // Determine it
                $isSet = isset($fieldArray[$fieldName]);
@@ -3253,7 +3256,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                                        $isReachable = TRUE;
                                } // END - if
                        } // END - foreach
-               } // END - if
+               } else {
+                       // If open_basedir is not set, all is allowed
+                       $isReachable = TRUE;
+               }
 
                // Return status
                return $isReachable;
@@ -3271,7 +3277,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $isReadable = FALSE;
 
                // Is within parameters, so check if it is a file and readable
-               $isReadable = ((self::isReachableFilePath($fileName)) && (is_file($fileName)) && (is_readable($fileName)));
+               $isReadable = ((self::isReachableFilePath($fileName)) && (file_exists($fileName)) && (is_file($fileName)) && (is_readable($fileName)));
 
                // Return status
                return $isReadable;