]> git.mxchange.org Git - core.git/commitdiff
Fixed (again) some more generic array handling
authorRoland Häder <roland@mxchange.org>
Fri, 28 Jun 2013 23:39:16 +0000 (23:39 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 28 Jun 2013 23:39:16 +0000 (23:39 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/debug/class_DebugWebOutput.php
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/stacker/class_BaseStacker.php

index 62b79bda0d49440bd0827c1d076fd0ff5a8312e3..34b0a22e6a716924f51b6e622b18345175f1e499 100644 (file)
@@ -426,7 +426,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Output stub message
                // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
 
                // Output stub message
                // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
-               self::createDebugInstance(__CLASS__)->debugOutput(sprintf("[unknown::%s:] Stub! Args: %s",
+               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[unknown::%s:] Stub! Args: %s',
                        $methodName,
                        $argsString
                ));
                        $methodName,
                        $argsString
                ));
@@ -452,7 +452,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        public final function __set ($name, $value) {
         * @return      void
         */
        public final function __set ($name, $value) {
-               $this->debugBackTrace(sprintf("Tried to set a missing field. name=%s, value[%s]=%s",
+               $this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s',
                        $name,
                        gettype($value),
                        $value
                        $name,
                        gettype($value),
                        $value
@@ -466,7 +466,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        public final function __get ($name) {
         * @return      void
         */
        public final function __get ($name) {
-               $this->debugBackTrace(sprintf("Tried to get a missing field. name=%s",
+               $this->debugBackTrace(sprintf('Tried to get a missing field. name=%s',
                        $name
                ));
        }
                        $name
                ));
        }
@@ -478,7 +478,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        public final function __unset ($name) {
         * @return      void
         */
        public final function __unset ($name) {
-               $this->debugBackTrace(sprintf("Tried to unset a missing field. name=%s",
+               $this->debugBackTrace(sprintf('Tried to unset a missing field. name=%s',
                        $name
                ));
        }
                        $name
                ));
        }
@@ -1337,11 +1337,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is a message set?
                if (!empty($message)) {
                        // Construct message
                // Is a message set?
                if (!empty($message)) {
                        // Construct message
-                       $content = sprintf("<div class=\"debug_message\">Message: %s</div>\n", $message);
+                       $content = sprintf('<div class="debug_message">Message: %s</div>' . PHP_EOL, $message);
                } // END - if
 
                // Generate the output
                } // END - if
 
                // Generate the output
-               $content .= sprintf("<pre>%s</pre>",
+               $content .= sprintf('<pre>%s</pre>',
                        trim(
                                htmlentities(
                                        print_r($this, true)
                        trim(
                                htmlentities(
                                        print_r($this, true)
@@ -1350,7 +1350,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                );
 
                // Output it
                );
 
                // Output it
-               ApplicationEntryPoint::app_exit(sprintf("<div class=\"debug_header\">%s debug output:</div><div class=\"debug_content\">%s</div>\nLoaded includes: <div class=\"debug_include_list\">%s</div>",
+               ApplicationEntryPoint::app_exit(sprintf('<div class="debug_header">%s debug output:</div><div class="debug_content">%s</div>Loaded includes: <div class="debug_include_list">%s</div>',
                        $this->__toString(),
                        $content,
                        ClassLoader::getSelfInstance()->getPrintableIncludeList()
                        $this->__toString(),
                        $content,
                        ClassLoader::getSelfInstance()->getPrintableIncludeList()
@@ -1463,6 +1463,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $debugInstance;
        }
 
                return $debugInstance;
        }
 
+       /**
+        * Simple output of a message with line-break
+        *
+        * @param       $message        Message to output
+        * @return      void
+        */
+       public function outputLine ($message) {
+               // Simply output it
+               print($message . PHP_EOL);
+       }
+
        /**
         * Outputs a debug message whether to debug instance (should be set!) or
         * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
        /**
         * Outputs a debug message whether to debug instance (should be set!) or
         * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
@@ -1504,7 +1515,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Put directly out
                        if ($doPrint === TRUE) {
                                // Print message
                        // Put directly out
                        if ($doPrint === TRUE) {
                                // Print message
-                               print($message . chr(10));
+                               $this->outputLine($message);
                        } else {
                                // Die here
                                exit($message);
                        } else {
                                // Die here
                                exit($message);
@@ -2128,6 +2139,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayElementSet ($keyGroup, $subGroup, $key, $element) {
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayElementSet ($keyGroup, $subGroup, $key, $element) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
+
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
 
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
 
@@ -2143,6 +2157,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayKeySet ($keyGroup, $subGroup, $key) {
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayKeySet ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
 
@@ -2159,6 +2176,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $isset          Whether the given group is set
         */
        protected final function isGenericArrayGroupSet ($keyGroup, $subGroup) {
         * @return      $isset          Whether the given group is set
         */
        protected final function isGenericArrayGroupSet ($keyGroup, $subGroup) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
+
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup]);
 
                // Is it there?
                $isset = isset($this->genericArray[$keyGroup][$subGroup]);
 
@@ -2180,8 +2200,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.');
                } // END - if
 
                        trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.');
                } // END - if
 
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], TRUE));
+
                // Return it
                // Return it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' returning!' . PHP_EOL);
                return $this->genericArray[$keyGroup][$subGroup];
        }
 
                return $this->genericArray[$keyGroup][$subGroup];
        }
 
@@ -2194,8 +2216,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        protected final function unsetGenericArrayKey ($keyGroup, $subGroup, $key) {
         * @return      void
         */
        protected final function unsetGenericArrayKey ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Remove it
                // Remove it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
                unset($this->genericArray[$keyGroup][$subGroup][$key]);
        }
 
                unset($this->genericArray[$keyGroup][$subGroup][$key]);
        }
 
@@ -2209,8 +2233,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
         * @return      void
         */
        protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
+
                // Remove it
                // Remove it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
                unset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
        }
 
                unset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
        }
 
@@ -2223,7 +2249,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $value          Value to add/append
         * @return      void
         */
         * @param       $value          Value to add/append
         * @return      void
         */
-       protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $value, $appendGlue = '') {
+       protected final function appendStringToGenericArrayKey ($keyGroup, $subGroup, $key, $value, $appendGlue = '') {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue);
+
                // Is it already there?
                if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Append it
                // Is it already there?
                if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Append it
@@ -2235,7 +2264,54 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
        }
 
        /**
-        * Initializes given generic array
+        * Append a string to a given generic array element
+        *
+        * @param       $keyGroup       Main group for the key
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to unset
+        * @param       $element        Element to check
+        * @param       $value          Value to add/append
+        * @return      void
+        */
+       protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue);
+
+               // Is it already there?
+               if ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
+                       // Append it
+                       $this->genericArray[$keyGroup][$subGroup][$key][$element] .= $appendGlue . (string) $value;
+               } else {
+                       // Add it
+                       $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value;
+               }
+       }
+
+       /**
+        * Initializes given generic array group
+        *
+        * @param       $keyGroup       Main group for the key
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to use
+        * @param       $forceInit      Optionally force initialization
+        * @return      void
+        */
+       protected final function initGenericArrayGroup ($keyGroup, $subGroup, $forceInit = FALSE) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',forceInit=' . intval($forceInit));
+
+               // Is it already set?
+               if (($forceInit === FALSE) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
+                       // Already initialized
+                       trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.');
+               } // END - if
+
+               // Initialize it
+               $this->genericArray[$keyGroup][$subGroup] = array();
+       }
+
+       /**
+        * Initializes given generic array key
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
@@ -2244,6 +2320,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
         * @return      void
         */
        protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',forceInit=' . intval($forceInit));
+
                // Is it already set?
                if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
                // Is it already set?
                if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
@@ -2251,10 +2330,33 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Initialize it
                } // END - if
 
                // Initialize it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . PHP_EOL);
                $this->genericArray[$keyGroup][$subGroup][$key] = array();
        }
 
                $this->genericArray[$keyGroup][$subGroup][$key] = array();
        }
 
+       /**
+        * Initializes given generic array element
+        *
+        * @param       $keyGroup       Main group for the key
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to use
+        * @param       $element        Element to use
+        * @param       $forceInit      Optionally force initialization
+        * @return      void
+        */
+       protected final function initGenericArrayElement ($keyGroup, $subGroup, $key, $element, $forceInit = FALSE) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',forceInit=' . intval($forceInit));
+
+               // Is it already set?
+               if (($forceInit === FALSE) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
+                       // Already initialized
+                       trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.');
+               } // END - if
+
+               // Initialize it
+               $this->genericArray[$keyGroup][$subGroup][$key][$element] = array();
+       }
+
        /**
         * Pushes an element to a generic key
         *
        /**
         * Pushes an element to a generic key
         *
@@ -2264,7 +2366,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $value          Value to add/append
         * @return      $count          Number of array elements
         */
         * @param       $value          Value to add/append
         * @return      $count          Number of array elements
         */
-       protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $value) {
+       protected final function pushValueToGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Initialize array
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Initialize array
@@ -2272,7 +2377,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Then push it
                } // END - if
 
                // Then push it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL);
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value);
 
                // Return count
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value);
 
                // Return count
@@ -2281,6 +2385,35 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $count;
        }
 
                return $count;
        }
 
+       /**
+        * Pushes an element to a generic array element
+        *
+        * @param       $keyGroup       Main group for the key
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to use
+        * @param       $element        Element to check
+        * @param       $value          Value to add/append
+        * @return      $count          Number of array elements
+        */
+       protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+
+               // Is it set?
+               if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
+                       // Initialize array
+                       $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element);
+               } // END - if
+
+               // Then push it
+               $count = array_push($this->genericArray[$keyGroup][$subGroup][$key][$element], $value);
+
+               // Return count
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
+               //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
+               return $count;
+       }
+
        /**
         * Pops an element from  a generic group
         *
        /**
         * Pops an element from  a generic group
         *
@@ -2290,6 +2423,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $value          Last "popped" value
         */
        protected final function popGenericArrayElement ($keyGroup, $subGroup, $key) {
         * @return      $value          Last "popped" value
         */
        protected final function popGenericArrayElement ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
@@ -2297,7 +2433,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Then "pop" it
                } // END - if
 
                // Then "pop" it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' pop-ing entry ...' . PHP_EOL);
                $value = array_pop($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
                $value = array_pop($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
@@ -2315,6 +2450,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $value          Last "popped" value
         */
        protected final function shiftGenericArrayElement ($keyGroup, $subGroup, $key) {
         * @return      $value          Last "popped" value
         */
        protected final function shiftGenericArrayElement ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
@@ -2322,12 +2460,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Then "shift" it
                } // END - if
 
                // Then "shift" it
-               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' shifting entry ...' . PHP_EOL);
                $value = array_shift($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
                $value = array_shift($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
-               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . $value . PHP_EOL);
+               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL);
                return $value;
        }
 
                return $value;
        }
 
@@ -2338,6 +2475,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $count          Count of given group
         */
        protected final function countGenericArray ($keyGroup) {
         * @return      $count          Count of given group
         */
        protected final function countGenericArray ($keyGroup) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
+
                // Is it there?
                if (!isset($this->genericArray[$keyGroup])) {
                        // Abort here
                // Is it there?
                if (!isset($this->genericArray[$keyGroup])) {
                        // Abort here
@@ -2347,6 +2487,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Then count it
                $count = count($this->genericArray[$keyGroup]);
 
                // Then count it
                $count = count($this->genericArray[$keyGroup]);
 
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',count=' . $count);
+
                // Return it
                return $count;
        }
                // Return it
                return $count;
        }
@@ -2359,6 +2502,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $count          Count of given group
         */
        protected final function countGenericArrayGroup ($keyGroup, $subGroup) {
         * @return      $count          Count of given group
         */
        protected final function countGenericArrayGroup ($keyGroup, $subGroup) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
+
                // Is it there?
                if (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
                        // Abort here
                // Is it there?
                if (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
                        // Abort here
@@ -2368,6 +2514,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup]);
 
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup]);
 
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',count=' . $count);
+
                // Return it
                return $count;
        }
                // Return it
                return $count;
        }
@@ -2381,6 +2530,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $count          Count of given key
         */
        protected final function countGenericArrayElements ($keyGroup, $subGroup, $key) {
         * @return      $count          Count of given key
         */
        protected final function countGenericArrayElements ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Is it there?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Abort here
                // Is it there?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Abort here
@@ -2392,7 +2544,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup][$key]);
-               //* DEBUG: */ print(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',count=' . $count . PHP_EOL);
+
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',count=' . $count);
 
                // Return it
                return $count;
 
                // Return it
                return $count;
@@ -2405,6 +2559,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $array          Whole generic array group
         */
        protected final function getGenericArray ($keyGroup) {
         * @return      $array          Whole generic array group
         */
        protected final function getGenericArray ($keyGroup) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
+
                // Is it there?
                if (!isset($this->genericArray[$keyGroup])) {
                        // Then abort here
                // Is it there?
                if (!isset($this->genericArray[$keyGroup])) {
                        // Then abort here
@@ -2425,6 +2582,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        protected final function setGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
         * @return      void
         */
        protected final function setGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+
                // Set value here
                $this->genericArray[$keyGroup][$subGroup][$key] = $value;
        }
                // Set value here
                $this->genericArray[$keyGroup][$subGroup][$key] = $value;
        }
@@ -2438,6 +2598,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $value          Mixed value from generic array element
         */
        protected final function getGenericArrayKey ($keyGroup, $subGroup, $key) {
         * @return      $value          Mixed value from generic array element
         */
        protected final function getGenericArrayKey ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Is it there?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Then abort here
                // Is it there?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Then abort here
@@ -2459,6 +2622,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
         * @return      void
         */
        protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
+               // Debug message
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+
                // Then set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value;
        }
                // Then set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value;
        }
@@ -2473,6 +2639,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $value          Mixed value from generic array element
         */
        protected final function getGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
         * @return      $value          Mixed value from generic array element
         */
        protected final function getGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
+
                // Is it there?
                if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
                        // Then abort here
                // Is it there?
                if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
                        // Then abort here
@@ -2491,6 +2660,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $isValid        Whether given sub group is valid
         */
        protected final function isValidGenericArrayGroup ($keyGroup, $subGroup) {
         * @return      $isValid        Whether given sub group is valid
         */
        protected final function isValidGenericArrayGroup ($keyGroup, $subGroup) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
+
                // Determine it
                $isValid = (($this->isGenericArrayGroupSet($keyGroup, $subGroup)) && (is_array($this->getGenericSubArray($keyGroup, $subGroup))));
 
                // Determine it
                $isValid = (($this->isGenericArrayGroupSet($keyGroup, $subGroup)) && (is_array($this->getGenericSubArray($keyGroup, $subGroup))));
 
@@ -2507,6 +2679,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $isValid        Whether given sub group is valid
         */
        protected final function isValidGenericArrayKey ($keyGroup, $subGroup, $key) {
         * @return      $isValid        Whether given sub group is valid
         */
        protected final function isValidGenericArrayKey ($keyGroup, $subGroup, $key) {
+               // Debug message
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+
                // Determine it
                $isValid = (($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) && (is_array($this->getGenericArrayKey($keyGroup, $subGroup, $key))));
 
                // Determine it
                $isValid = (($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) && (is_array($this->getGenericArrayKey($keyGroup, $subGroup, $key))));
 
index 78a4e828a110545be024e77829791ead0633dfbc..fd8e16daebed1de0cd1378b3bc6236981b82ee82 100644 (file)
@@ -171,7 +171,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Append it
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Append it
-               $this->appendStringToGenericArrayElement('criteria', $criteriaType, $criteriaKey, $criteriaValue);
+               $this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
        }
 
        /**
        }
 
        /**
@@ -190,7 +190,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Add it
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Add it
-               $this->pushValueToGenericArrayElement('criteria', 'choice', $this->convertDashesToUnderscores($criteriaKey), (string) $criteriaValue);
+               $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', $this->convertDashesToUnderscores($criteriaKey), (string) $criteriaValue);
        }
 
        /**
        }
 
        /**
@@ -243,7 +243,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                // Is the criteria there?
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
                        // Then use it
                // Is the criteria there?
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
                        // Then use it
-                       $value = $this->getGenericArrayKey('criteria', $criteriaType, $criteriaKey);
+                       $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
                } // END - if
 
                // Return the value
                } // END - if
 
                // Return the value
index 1bb31f4d0db823470b86d81e446f550d81192740..e5cb74eac7ded76f7279dcaffcffb7503d1dd991 100644 (file)
@@ -415,7 +415,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                        } // END - if
                                } else {
                                        // Throw an exception here
                                        } // END - if
                                } else {
                                        // Throw an exception here
-                                       throw new SqlException(array($this, sprintf("File &#39;%s&#39; contains invalid data.", $dataFile), self::DB_CODE_DATA_FILE_CORRUPT), self::EXCEPTION_SQL_QUERY);
+                                       throw new SqlException(array($this, sprintf('File &#39;%s&#39; contains invalid data.', $dataFile), self::DB_CODE_DATA_FILE_CORRUPT), self::EXCEPTION_SQL_QUERY);
                                }
 
                                // Count entry up
                                }
 
                                // Count entry up
@@ -433,7 +433,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                        $this->setLastException($e);
 
                        // So throw an SqlException here with faked error message
                        $this->setLastException($e);
 
                        // So throw an SqlException here with faked error message
-                       throw new SqlException (array($this, sprintf("Table &#39;%s&#39; not found", $tableName), self::DB_CODE_TABLE_MISSING), self::EXCEPTION_SQL_QUERY);
+                       throw new SqlException (array($this, sprintf('Table &#39;%s&#39; not found', $tableName), self::DB_CODE_TABLE_MISSING), self::EXCEPTION_SQL_QUERY);
                } catch (FrameworkException $e) {
                        // Catch all exceptions and store them in last error
                        $this->setLastException($e);
                } catch (FrameworkException $e) {
                        // Catch all exceptions and store them in last error
                        $this->setLastException($e);
@@ -469,7 +469,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                        $this->setLastException($e);
 
                        // Throw an SQL exception
                        $this->setLastException($e);
 
                        // Throw an SQL exception
-                       throw new SqlException(array($this, sprintf("Cannot write data to table &#39;%s&#39;, is the table created?", $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+                       throw new SqlException(array($this, sprintf('Cannot write data to table &#39;%s&#39;, is the table created?', $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
                }
        }
 
                }
        }
 
index 7ffe5b55e01fbf63ba5f8b17875b7f1dbd93f7c6..b851abac8816cd18b05bacf9e9efc1a25c24fd6a 100644 (file)
@@ -54,7 +54,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre
         */
        public final function outputStream ($output, $stripTags = FALSE) {
                // Strip out <br />
         */
        public final function outputStream ($output, $stripTags = FALSE) {
                // Strip out <br />
-               $output = str_replace("<br />", '', $output);
+               $output = str_replace('<br />', '', $output);
                print(stripslashes($output)."<br />\n");
        }
 
                print(stripslashes($output)."<br />\n");
        }
 
index 4f15fa13cd51334e349ecd8c2c52d4341936dc32..d1374a59245337d1452c7d37e168a13046acc64c 100644 (file)
@@ -52,7 +52,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         * @return      void
         */
        public final function addFilter (Filterable $filterInstance) {
         * @return      void
         */
        public final function addFilter (Filterable $filterInstance) {
-               $this->pushValueToGenericArrayElement('filters', 'generic', 'dummy', $filterInstance);
+               $this->pushValueToGenericArrayKey('filters', 'generic', 'dummy', $filterInstance);
        }
 
        /**
        }
 
        /**
index 9d9b12126d5703a1c20e22352644cb71045e90c8..8e7a1545a399cde9d2a0e2c034def3aac36f9549 100644 (file)
@@ -68,7 +68,7 @@ class BaseMailer extends BaseFrameworkSystem {
                $templateName = $this->getTemplateName();
 
                // Is the list initialized?
                $templateName = $this->getTemplateName();
 
                // Is the list initialized?
-               $this->pushValueToGenericArrayElement('recipients', $templateName, 'recipients', $userInstance);
+               $this->pushValueToGenericArrayKey('recipients', $templateName, 'recipients', $userInstance);
        }
 
        /**
        }
 
        /**
index 629c9a1179f0e7a3f141e1cd47513d6def4513f6..91914e1c1f709d9b89ee6e8981174812b16d7b49 100644 (file)
@@ -41,6 +41,9 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
+
+               // Init raw array
+               $this->initGenericArrayGroup('raw', 'generic');
        }
 
        /**
        }
 
        /**
@@ -90,7 +93,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
                assert(!is_array($key));
 
                // Push it
                assert(!is_array($key));
 
                // Push it
-               $this->pushValueToGenericArrayElement('raw', 'generic', $key, $value);
+               $this->pushValueToGenericArrayKey('raw', 'generic', $key, $value);
        }
 
        /**
        }
 
        /**
index a2d0e302bd840d3d97e001bfcd17af123b41d0d9..7c63857c1a0f78bab5fa32ebc0fad6d2d41afba5 100644 (file)
@@ -131,7 +131,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessagePlain ($message) {
                // Adds the resolved message id to the fatal message list
         */
        public final function addFatalMessagePlain ($message) {
                // Adds the resolved message id to the fatal message list
-               $this->pushValueToGenericArrayElement('fatal_messages', 'generic', 'message', $message);
+               $this->pushValueToGenericArrayKey('fatal_messages', 'generic', 'message', $message);
        }
 
        /**
        }
 
        /**
index a3419fe486db58647b1463e2b3eea823e44180db..32dc9d9cc8dc857d5a2508265ca8409ecdaaded5 100644 (file)
@@ -154,7 +154,7 @@ class BaseStacker extends BaseFrameworkSystem {
                }
 
                // Now add the value to the stack
                }
 
                // Now add the value to the stack
-               $this->pushValueToGenericArrayElement('stacks', $stackerName, 'entries', $value);
+               $this->pushValueToGenericArrayKey('stacks', $stackerName, 'entries', $value);
        }
 
        /**
        }
 
        /**