]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/class_BaseFrameworkSystem.php
Using the bebug middleware class will become deprecated (now already marked
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index 56b1cbfa36bd25465069feb27892b74181983c29..e3d1584869e1be61fc0b5ea8c26bbc48737a5341 100644 (file)
@@ -218,6 +218,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $communicatorInstance = NULL;
 
+       /**
+        * The concrete output instance
+        */
+       private $outputInstance = NULL;
+
        /**
         * State instance
         */
@@ -359,8 +364,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        const EXCEPTION_FILE_NOT_REACHABLE           = 0x038;
        const EXCEPTION_FILE_CANNOT_BE_READ          = 0x039;
        const EXCEPTION_FILE_CANNOT_BE_WRITTEN       = 0x03a;
-       const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x03b;
-       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x03c;
+       const EXCEPTION_PATH_CANNOT_BE_WRITTEN       = 0x03b;
+       const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x03c;
+       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x03d;
 
        /**
         * Hexadecimal->Decimal translation array
@@ -438,7 +444,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Destructor for all classes
+        * Destructor for all classes. You should not call this method on your own.
         *
         * @return      void
         */
@@ -1562,6 +1568,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->stateInstance;
        }
 
+       /**
+        * Setter for output instance
+        *
+        * @param       $outputInstance The debug output instance
+        * @return      void
+        */
+       public final function setOutputInstance (OutputStreamer $outputInstance) {
+               $this->outputInstance = $outputInstance;
+       }
+
+       /**
+        * Getter for output instance
+        *
+        * @return      $outputInstance The debug output instance
+        */
+       public final function getOutputInstance () {
+               return $this->outputInstance;
+       }
+
        /**
         * Setter for command name
         *
@@ -1846,6 +1871,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @param       $className              Name of the class (currently unsupported)
         * @return      $debugInstance  An instance of a debugger class
+        * @deprecated  Not fully, as the new Logger facilities are not finished yet.
         */
        public final static function createDebugInstance ($className) {
                // Is the instance set?
@@ -1856,7 +1882,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_class'));
+                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_class'), $className);
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit('Cannot create debugInstance! Exception=' . $e->__toString() . ', message=' . $e->getMessage());
@@ -2199,7 +2225,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $configEntry = $resultInstance->getUpdateInstance()->getWrapperConfigEntry();
 
                        // Create object instance
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
+                       $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName($configEntry);
 
                        // Yes, then send the whole result to the database layer
                        $wrapperInstance->doUpdateByResult($this->getResultInstance());