need to import Stateable, too. More may follow (aftermath of namespacing)
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index 7185309257cc39270935f016fdd5ac9c99150785..3eaf3d2fea4a6b3bfb6ca98d90dfc797445ba111 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Object;
 
 // Import framework stuff
 namespace CoreFramework\Object;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Compressor\Compressor;
 use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Connection\Database\DatabaseConnection;
 use CoreFramework\Compressor\Compressor;
 use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Connection\Database\DatabaseConnection;
@@ -10,12 +11,21 @@ use CoreFramework\Controller\Controller;
 use CoreFramework\Criteria\Criteria;
 use CoreFramework\Criteria\Local\LocalSearchCriteria;
 use CoreFramework\Criteria\Local\LocalUpdateCriteria;
 use CoreFramework\Criteria\Criteria;
 use CoreFramework\Criteria\Local\LocalSearchCriteria;
 use CoreFramework\Criteria\Local\LocalUpdateCriteria;
+use CoreFramework\Crypto\Cryptable;
+use CoreFramework\Crypto\RandomNumber\RandomNumberGenerator;
+use CoreFramework\Database\Frontend\DatabaseWrapper;
 use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Filesystem\Block;
+use CoreFramework\Filesystem\FilePointer;
 use CoreFramework\Filesystem\FrameworkDirectory;
 use CoreFramework\Filesystem\FrameworkDirectory;
+use CoreFramework\Filesystem\PathWriteProtectedException;
 use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Handler\Stream\IoHandler;
 use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Handler\Stream\IoHandler;
+use CoreFramework\Index\Indexable;
+use CoreFramework\Listener\Listenable;
+use CoreFramework\Lists\Listable;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Middleware\Compressor\CompressorChannel;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Middleware\Compressor\CompressorChannel;
@@ -23,17 +33,19 @@ use CoreFramework\Middleware\Debug\DebugMiddleware;
 use CoreFramework\Parser\Parseable;
 use CoreFramework\Registry\Register;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Parser\Parseable;
 use CoreFramework\Registry\Register;
 use CoreFramework\Registry\Registry;
-use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Resolver;
 use CoreFramework\Result\Database\CachedDatabaseResult;
 use CoreFramework\Result\Search\SearchableResult;
 use CoreFramework\Resolver\Resolver;
 use CoreFramework\Result\Database\CachedDatabaseResult;
 use CoreFramework\Result\Search\SearchableResult;
-use CoreFramework\Response\Responseable;
+use CoreFramework\Stacker\Stackable;
+use CoreFramework\State\Stateable;
 use CoreFramework\Stream\Output\OutputStreamer;
 use CoreFramework\Template\CompileableTemplate;
 use CoreFramework\Stream\Output\OutputStreamer;
 use CoreFramework\Template\CompileableTemplate;
-use CoreFramework\Wrapper\Database\DatabaseWrapper;
+use CoreFramework\User\ManageableAccount;
+use CoreFramework\Visitor\Visitor;
 
 // Import SPL stuff
 use \stdClass;
 
 // Import SPL stuff
 use \stdClass;
+use \Iterator;
 use \ReflectionClass;
 
 /**
 use \ReflectionClass;
 
 /**
@@ -70,16 +82,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $realClass = 'BaseFrameworkSystem';
 
         */
        private $realClass = 'BaseFrameworkSystem';
 
-       /**
-        * Instance of a Requestable class
-        */
-       private $requestInstance = NULL;
-
-       /**
-        * Instance of a Responseable class
-        */
-       private $responseInstance = NULL;
-
        /**
         * Search criteria instance
         */
        /**
         * Search criteria instance
         */
@@ -278,7 +280,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Socket resource
         */
        /**
         * Socket resource
         */
-       private $socketResource = FALSE;
+       private $socketResource = false;
 
        /**
         * Regular expression to use for validation
 
        /**
         * Regular expression to use for validation
@@ -336,7 +338,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * The integer size is 4 bytes on 32-bit and 8 bytes on a 64-bit system.
         */
         *
         * The integer size is 4 bytes on 32-bit and 8 bytes on a 64-bit system.
         */
-       private $archArrayElement = FALSE;
+       private $archArrayElement = false;
 
        /***********************
         * Exception codes.... *
 
        /***********************
         * Exception codes.... *
@@ -470,10 +472,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
                } // END - if
 
                        $this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
                } // END - if
 
-               // Is the startup time set? (0 cannot be TRUE anymore)
+               // Is the startup time set? (0 cannot be true anymore)
                if (self::$startupTime == 0) {
                        // Then set it
                if (self::$startupTime == 0) {
                        // Then set it
-                       self::$startupTime = microtime(TRUE);
+                       self::$startupTime = microtime(true);
                } // END - if
 
                // Set array element
                } // END - if
 
                // Set array element
@@ -562,12 +564,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                                        // Is an other object, maybe no __toString() available
                                        $argsString .= $reflection->getName();
 
                                        // Is an other object, maybe no __toString() available
                                        $argsString .= $reflection->getName();
-                               } elseif ($arg === TRUE) {
-                                       // ... is boolean 'TRUE'
-                                       $argsString .= 'TRUE';
-                               } elseif ($arg === FALSE) {
-                                       // ... is boolean 'FALSE'
-                                       $argsString .= 'FALSE';
+                               } elseif ($arg === true) {
+                                       // ... is boolean 'true'
+                                       $argsString .= 'true';
+                               } elseif ($arg === false) {
+                                       // ... is boolean 'false'
+                                       $argsString .= 'false';
                                }
 
                                // Comma for next one
                                }
 
                                // Comma for next one
@@ -617,7 +619,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s',
                        $name,
                        gettype($value),
                $this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s',
                        $name,
                        gettype($value),
-                       print_r($value, TRUE)
+                       print_r($value, true)
                ));
        }
 
                ));
        }
 
@@ -895,7 +897,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $applicationInstance    An instance of a manageable application helper class
         */
        protected final function getApplicationInstance () {
         * @return      $applicationInstance    An instance of a manageable application helper class
         */
        protected final function getApplicationInstance () {
-               $applicationInstance = Registry::getRegistry()->getInstance('application');
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
                return $applicationInstance;
        }
 
                return $applicationInstance;
        }
 
@@ -909,44 +911,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                Registry::getRegistry()->addInstance('application', $applicationInstance);
        }
 
                Registry::getRegistry()->addInstance('application', $applicationInstance);
        }
 
-       /**
-        * Setter for request instance
-        *
-        * @param       $requestInstance        An instance of a Requestable class
-        * @return      void
-        */
-       public final function setRequestInstance (Requestable $requestInstance) {
-               $this->requestInstance = $requestInstance;
-       }
-
-       /**
-        * Getter for request instance
-        *
-        * @return      $requestInstance        An instance of a Requestable class
-        */
-       public final function getRequestInstance () {
-               return $this->requestInstance;
-       }
-
-       /**
-        * Setter for response instance
-        *
-        * @param       $responseInstance       An instance of a Responseable class
-        * @return      void
-        */
-       public final function setResponseInstance (Responseable $responseInstance) {
-               $this->responseInstance = $responseInstance;
-       }
-
-       /**
-        * Getter for response instance
-        *
-        * @return      $responseInstance       An instance of a Responseable class
-        */
-       public final function getResponseInstance () {
-               return $this->responseInstance;
-       }
-
        /**
         * Private getter for language instance
         *
        /**
         * Private getter for language instance
         *
@@ -1781,7 +1745,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is the application instance set?
                if (is_null($applicationInstance)) {
                        // Get the current instance
                // Is the application instance set?
                if (is_null($applicationInstance)) {
                        // Get the current instance
-                       $applicationInstance = $this->getApplicationInstance();
+                       $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                        // Still null?
                        if (is_null($applicationInstance)) {
 
                        // Still null?
                        if (is_null($applicationInstance)) {
@@ -1820,7 +1784,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $content .= sprintf('<pre>%s</pre>',
                        trim(
                                htmlentities(
                $content .= sprintf('<pre>%s</pre>',
                        trim(
                                htmlentities(
-                                       print_r($this, TRUE)
+                                       print_r($this, true)
                                )
                        )
                );
                                )
                        )
                );
@@ -1894,10 +1858,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * Outputs a debug backtrace and stops further script execution
         *
         * @param       $message        An optional message to output
         * Outputs a debug backtrace and stops further script execution
         *
         * @param       $message        An optional message to output
-        * @param       $doExit         Whether exit the program (TRUE is default)
+        * @param       $doExit         Whether exit the program (true is default)
         * @return      void
         */
         * @return      void
         */
-       public function debugBackTrace ($message = '', $doExit = TRUE) {
+       public function debugBackTrace ($message = '', $doExit = true) {
                // Sorry, there is no other way getting this nice backtrace
                if (!empty($message)) {
                        // Output message
                // Sorry, there is no other way getting this nice backtrace
                if (!empty($message)) {
                        // Output message
@@ -1909,7 +1873,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                print('</pre>');
 
                // Exit program?
                print('</pre>');
 
                // Exit program?
-               if ($doExit === TRUE) {
+               if ($doExit === true) {
                        exit();
                } // END - if
        }
                        exit();
                } // END - if
        }
@@ -1931,7 +1895,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Try it
                        try {
                                // Get a debugger instance
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_class'), $className);
+                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber));
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber));
@@ -1969,10 +1933,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @param       $message        Message we shall send out...
         * @param       $doPrint        Whether print or die here (default: print)
         *
         * @param       $message        Message we shall send out...
         * @param       $doPrint        Whether print or die here (default: print)
-        * @paran       $stripTags      Whether to strip tags (default: FALSE)
+        * @paran       $stripTags      Whether to strip tags (default: false)
         * @return      void
         */
         * @return      void
         */
-       public function debugOutput ($message, $doPrint = TRUE, $stripTags = FALSE) {
+       public function debugOutput ($message, $doPrint = true, $stripTags = false) {
                // Set debug instance to NULL
                $debugInstance = NULL;
 
                // Set debug instance to NULL
                $debugInstance = NULL;
 
@@ -1989,19 +1953,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Use debug output handler
                        $debugInstance->output($message, $stripTags);
 
                        // Use debug output handler
                        $debugInstance->output($message, $stripTags);
 
-                       if ($doPrint === FALSE) {
+                       if ($doPrint === false) {
                                // Die here if not printed
                                exit();
                        } // END - if
                } else {
                        // Are debug times enabled?
                                // Die here if not printed
                                exit();
                        } // END - if
                } else {
                        // Are debug times enabled?
-                       if ($this->getConfigInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_output_timings') == 'Y') {
+                       if ($this->getConfigInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
                                // Prepent it
                                $message = $this->getPrintableExecutionTime() . $message;
                        } // END - if
 
                        // Put directly out
                                // Prepent it
                                $message = $this->getPrintableExecutionTime() . $message;
                        } // END - if
 
                        // Put directly out
-                       if ($doPrint === TRUE) {
+                       if ($doPrint === true) {
                                // Print message
                                $this->outputLine($message);
                        } else {
                                // Print message
                                $this->outputLine($message);
                        } else {
@@ -2170,7 +2134,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->getResultInstance()->rewind();
 
                // Do we have an entry?
                $this->getResultInstance()->rewind();
 
                // Do we have an entry?
-               if ($this->getResultInstance()->valid() === FALSE) {
+               if ($this->getResultInstance()->valid() === false) {
                        // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
                        throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), CachedDatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                } // END - if
                        // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
                        throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), CachedDatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                } // END - if
@@ -2207,7 +2171,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Get current array
                $fieldArray = $resultInstance->current();
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, TRUE).'</pre>');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
                $fieldName2 = self::convertDashesToUnderscores($fieldName);
 
                // Convert dashes to underscore
                $fieldName2 = self::convertDashesToUnderscores($fieldName);
@@ -2218,7 +2182,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $fieldValue = $fieldArray[$fieldName2];
                } elseif (defined('DEVELOPER')) {
                        // Missing field entry, may require debugging
                        $fieldValue = $fieldArray[$fieldName2];
                } elseif (defined('DEVELOPER')) {
                        // Missing field entry, may require debugging
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray<pre>=' . print_r($fieldArray, TRUE) . '</pre>,fieldName=' . $fieldName . ' not found!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray<pre>=' . print_r($fieldArray, true) . '</pre>,fieldName=' . $fieldName . ' not found!');
                } else {
                        // Missing field entry, may require debugging
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldName=' . $fieldName . ' not found!');
                } else {
                        // Missing field entry, may require debugging
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldName=' . $fieldName . ' not found!');
@@ -2247,7 +2211,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Get current array
                $fieldArray = $resultInstance->current();
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, TRUE).'</pre>');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
                $fieldName = self::convertDashesToUnderscores($fieldName);
 
                // Convert dashes to underscore
                $fieldName = self::convertDashesToUnderscores($fieldName);
@@ -2328,7 +2292,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public function getMilliTime () {
                // Get the time of day as float
         */
        public function getMilliTime () {
                // Get the time of day as float
-               $milliTime = gettimeofday(TRUE);
+               $milliTime = gettimeofday(true);
 
                // Return it
                return $milliTime;
 
                // Return it
                return $milliTime;
@@ -2341,7 +2305,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public function idle ($milliSeconds) {
                // Sleep is fine by default
         */
        public function idle ($milliSeconds) {
                // Sleep is fine by default
-               $hasSlept = TRUE;
+               $hasSlept = true;
 
                // Idle so long with found function
                if (function_exists('time_sleep_until')) {
 
                // Idle so long with found function
                if (function_exists('time_sleep_until')) {
@@ -2507,34 +2471,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected function isBase64Encoded ($encodedData) {
                // Determine it
         */
        protected function isBase64Encoded ($encodedData) {
                // Determine it
-               $isBase64 = (@base64_decode($encodedData, TRUE) !== FALSE);
+               $isBase64 = (@base64_decode($encodedData, true) !== false);
 
                // Return it
                return $isBase64;
        }
 
 
                // Return it
                return $isBase64;
        }
 
-       /**
-        * "Getter" to get response/request type from analysis of the system.
-        *
-        * @return      $responseType   Analyzed response type
-        */
-       protected static function getResponseTypeFromSystem () {
-               // Default is console
-               $responseType = 'console';
-
-               // Is 'HTTP_HOST' set?
-               if (isset($_SERVER['HTTP_HOST'])) {
-                       /*
-                        * Then it is a HTML response/request as RSS and so on may be
-                        * transfered over HTTP as well.
-                        */
-                       $responseType = 'html';
-               } // END - if
-
-               // Return it
-               return $responseType;
-       }
-
        /**
         * Gets a cache key from Criteria instance
         *
        /**
         * Gets a cache key from Criteria instance
         *
@@ -2570,7 +2512,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected function getPrintableExecutionTime () {
                // Caculate the execution time
         */
        protected function getPrintableExecutionTime () {
                // Caculate the execution time
-               $executionTime = microtime(TRUE) - $this->getStartupTime();
+               $executionTime = microtime(true) - $this->getStartupTime();
 
                // Pack it in nice braces
                $executionTime = sprintf('[ %01.5f ] ', $executionTime);
 
                // Pack it in nice braces
                $executionTime = sprintf('[ %01.5f ] ', $executionTime);
@@ -2619,18 +2561,18 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret            The (hopefully) secured numbered value
         */
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret            The (hopefully) secured numbered value
         */
-       public function bigintval ($num, $castValue = TRUE, $assertMismatch = FALSE) {
+       public function bigintval ($num, $castValue = true, $assertMismatch = false) {
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789]/', '', $num);
 
                // Shall we cast?
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789]/', '', $num);
 
                // Shall we cast?
-               if ($castValue === TRUE) {
+               if ($castValue === true) {
                        // Cast to biggest numeric type
                        $ret = (double) $ret;
                } // END - if
 
                // Assert only if requested
                        // Cast to biggest numeric type
                        $ret = (double) $ret;
                } // END - if
 
                // Assert only if requested
-               if ($assertMismatch === TRUE) {
+               if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
@@ -2646,12 +2588,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret    The (hopefully) secured hext-numbered value
         */
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret    The (hopefully) secured hext-numbered value
         */
-       public function hexval ($num, $assertMismatch = FALSE) {
+       public function hexval ($num, $assertMismatch = false) {
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789abcdefABCDEF]/', '', $num);
 
                // Assert only if requested
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789abcdefABCDEF]/', '', $num);
 
                // Assert only if requested
-               if ($assertMismatch === TRUE) {
+               if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
@@ -2747,7 +2689,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Debug message
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], TRUE));
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true));
 
                // Return it
                return $this->genericArray[$keyGroup][$subGroup];
 
                // Return it
                return $this->genericArray[$keyGroup][$subGroup];
@@ -2797,7 +2739,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function appendStringToGenericArrayKey ($keyGroup, $subGroup, $key, $value, $appendGlue = '') {
                // Debug message
         */
        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);
+               //* 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)) {
 
                // Is it already there?
                if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
@@ -2821,7 +2763,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') {
                // Debug message
         */
        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);
+               //* 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)) {
 
                // Is it already there?
                if ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
@@ -2845,7 +2787,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setStringGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') {
                // Debug message
         */
        protected final function setStringGenericArrayElement ($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);
+               //* 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);
 
                // Set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value;
 
                // Set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value;
@@ -2860,12 +2802,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayGroup ($keyGroup, $subGroup, $forceInit = FALSE) {
+       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?
                // 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))) {
+               if (($forceInit === false) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.');
                        exit;
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.');
                        exit;
@@ -2884,12 +2826,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
+       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?
                // 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))) {
+               if (($forceInit === false) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' already initialized.');
                        exit;
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' already initialized.');
                        exit;
@@ -2909,12 +2851,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayElement ($keyGroup, $subGroup, $key, $element, $forceInit = FALSE) {
+       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?
                // 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))) {
+               if (($forceInit === false) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.');
                        exit;
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.');
                        exit;
@@ -2935,7 +2877,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function pushValueToGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
                // Debug message
         */
        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));
+               //* 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)) {
 
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
@@ -2947,7 +2889,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value);
 
                // Return count
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value);
 
                // Return count
-               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
@@ -2964,7 +2906,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
                // Debug message
         */
        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));
+               //* 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)) {
 
                // Is it set?
                if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
@@ -2976,7 +2918,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key][$element], $value);
 
                // Return count
                $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__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
@@ -3004,8 +2946,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $value = array_pop($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
                $value = array_pop($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) . ']=' . print_r($value, TRUE) . PHP_EOL);
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
+               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
                return $value;
        }
 
                return $value;
        }
 
@@ -3032,8 +2974,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $value = array_shift($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
                $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) . ']=' . print_r($value, TRUE) . PHP_EOL);
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
+               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
                return $value;
        }
 
                return $value;
        }
 
@@ -3157,7 +3099,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
                // Debug message
         */
        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));
+               //* 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;
@@ -3198,7 +3140,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
                // Debug message
         */
        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));
+               //* 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;
@@ -3274,12 +3216,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
-               // Is this a response instance?
-               if ($this instanceof Responseable) {
-                       // Then set it in application instance
-                       $applicationInstance->setResponseInstance($this);
-               } // END - if
-
                // Init web output instance
                $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($applicationInstance));
 
                // Init web output instance
                $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($applicationInstance));
 
@@ -3288,7 +3224,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
        }
 
        /**
-        * Translates boolean TRUE to 'Y' and FALSE to 'N'
+        * Translates boolean true to 'Y' and false to 'N'
         *
         * @param       $boolean                Boolean value
         * @return      $translated             Translated boolean value
         *
         * @param       $boolean                Boolean value
         * @return      $translated             Translated boolean value
@@ -3298,7 +3234,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                assert(is_bool($boolean));
 
                // "Translate" it
                assert(is_bool($boolean));
 
                // "Translate" it
-               $translated = ($boolean === TRUE) ? 'Y' : 'N';
+               $translated = ($boolean === true) ? 'Y' : 'N';
 
                // ... and return it
                return $translated;
 
                // ... and return it
                return $translated;
@@ -3372,58 +3308,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $packed;
        }
 
                return $packed;
        }
 
-       /**
-        * Checks whether the given file/path is in open_basedir(). This does not
-        * gurantee that the file is actually readable and/or writeable. If you need
-        * such gurantee then please use isReadableFile() instead.
-        *
-        * @param       $filePathName   Name of the file/path to be checked
-        * @return      $isReachable    Whether it is within open_basedir()
-        */
-       protected static function isReachableFilePath ($filePathName) {
-               // Is not reachable by default
-               $isReachable = FALSE;
-
-               // Get open_basedir parameter
-               $openBaseDir = ini_get('open_basedir');
-
-               // Is it set?
-               if (!empty($openBaseDir)) {
-                       // Check all entries
-                       foreach (explode(PATH_SEPARATOR, $openBaseDir) as $dir) {
-                               // Check on existence
-                               if (substr($filePathName, 0, strlen($dir)) == $dir) {
-                                       // Is reachable
-                                       $isReachable = TRUE;
-                               } // END - if
-                       } // END - foreach
-               } else {
-                       // If open_basedir is not set, all is allowed
-                       $isReachable = TRUE;
-               }
-
-               // Return status
-               return $isReachable;
-       }
-
-       /**
-        * Checks whether the give file is within open_basedir() (done by
-        * isReachableFilePath()), is actually a file and is readable.
-        *
-        * @param       $fileName               Name of the file to be checked
-        * @return      $isReadable             Whether the file is readable (and therefor exists)
-        */
-       public static function isReadableFile ($fileName) {
-               // Default is not readable
-               $isReadable = FALSE;
-
-               // Is within parameters, so check if it is a file and readable
-               $isReadable = ((self::isReachableFilePath($fileName)) && (file_exists($fileName)) && (is_file($fileName)) && (is_readable($fileName)));
-
-               // Return status
-               return $isReadable;
-       }
-
        /**
         * Creates a full-qualified file name (FQFN) for given file name by adding
         * a configured temporary file path to it.
        /**
         * Creates a full-qualified file name (FQFN) for given file name by adding
         * a configured temporary file path to it.
@@ -3447,7 +3331,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $fqfn = $basePath . '/' . $fileName;
 
                // Is it reachable?
                $fqfn = $basePath . '/' . $fileName;
 
                // Is it reachable?
-               if (!self::isReachableFilePath($fqfn)) {
+               if (!FrameworkBootstrap::isReachableFilePath($fqfn)) {
                        // Not reachable
                        throw new FileIoException($fqfn, self::EXCEPTION_FILE_NOT_REACHABLE);
                } // END - if
                        // Not reachable
                        throw new FileIoException($fqfn, self::EXCEPTION_FILE_NOT_REACHABLE);
                } // END - if
@@ -3501,7 +3385,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Check socket array, 1st element is mostly IP address (or file name), 2nd is port number
                } // END - if
 
                // Check socket array, 1st element is mostly IP address (or file name), 2nd is port number
-               //* DEBUG-DIE: */ die(__METHOD__ . ':socketData=' . print_r($socketData, TRUE));
+               //* DEBUG-DIE: */ die(__METHOD__ . ':socketData=' . print_r($socketData, true));
                assert(isset($socketData[0]));
                assert(isset($socketData[1]));
 
                assert(isset($socketData[0]));
                assert(isset($socketData[1]));