Some rewrites
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index 4b2812dc41adfc530e6fbbb9fe106b0d69f71dc4..77390bc205f7851427ec7c2c3ff049f5c30ffbb9 100644 (file)
@@ -1355,7 +1355,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is the extra message given?
                if (!empty($message)) {
                        // Then add it as well
-                       $stubMessage .= sprintf(' Message: <span id="stub_message">%s</span>', $message);
+                       $stubMessage .= ' Message: ' . $message;
                } // END - if
 
                // Debug instance is there?
@@ -1364,7 +1364,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->debugOutput($stubMessage);
                } else {
                        // Trigger an error
-                       trigger_error($stubMessage . '<br />' . chr(10));
+                       trigger_error($stubMessage);
                }
        }
 
@@ -1393,13 +1393,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Outputs a debug message whether to debug instance (should be set!) or dies with or pints the message
+        * Outputs a debug message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the die() call to
+        * ApplicationEntryPoint::app_die(), this would cause an endless loop.
         *
         * @param       $message        Message we shall send out...
-        * @param       $doPrint        Whether we shall print or die here which first is the default
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
         * @return      void
         */
-       public function debugOutput ($message, $doPrint = true) {
+       public function debugOutput ($message, $doPrint = true, $stripTags = false) {
                // Set debug instance to NULL
                $debugInstance = NULL;
 
@@ -1414,28 +1417,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is the debug instance there?
                if (is_object($debugInstance)) {
                        // Use debug output handler
-                       $debugInstance->output($message);
+                       $debugInstance->output($message, $stripTags);
 
                        if ($doPrint === false) {
                                // Die here if not printed
                                die();
                        } // END - if
                } else {
+                       // Are debug times enabled?
+                       if ($this->getConfigInstance()->getConfigEntry('debug_output_timings') == 'Y') {
+                               // Prepent it
+                               $message = $this->getPrintableExecutionTime() . $message;
+                       } // END - if
+
                        // Put directly out
                        if ($doPrint === true) {
-                               // Are debug times enabled?
-                               if ($this->getConfigInstance()->getConfigEntry('debug_output_timings') == 'Y') {
-                                       // Output it first
-                                       print($this->getPrintableExecutionTime());
-                               } // END - if
-
                                // Print message
                                print($message . chr(10));
                        } else {
-                               /*
-                                * BIG FAT NOTE: Do NEVER rewrite this to app_die(), this will
-                                * cause an endless loop.
-                                */
+                               // Die here
                                die($message);
                        }
                }