]> git.mxchange.org Git - core.git/blobdiff - inc/classes/middleware/debug/class_DebugMiddleware.php
Added stripTags (default: false) to allow stripping out HTML tags
[core.git] / inc / classes / middleware / debug / class_DebugMiddleware.php
index 8d25477eca28c459171c86131b3fe43e2e92ee95..811ca5f66c4ee6e3d1b218a13168f4e40207e1a7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -27,12 +27,12 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
        /**
         * The concrete output instance
         */
-       private $outputInstance = null;
+       private $outputInstance = NULL;
 
        /**
         * An instance of this class
         */
-       private static $thisInstance = null;
+       private static $selfInstance = NULL;
 
        /**
         * Protected constructor
@@ -44,7 +44,10 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
                parent::__construct(__CLASS__);
 
                // Set own instance
-               self::$thisInstance = $this;
+               self::$selfInstance = $this;
+
+               // Set it so all can use it
+               $this->setDebugInstance($this);
        }
 
        /**
@@ -56,7 +59,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         *                                                      registering the *real* debug output
         * @return      $debugInstance  An instance of this middleware class
         */
-       public final static function createDebugMiddleware ($debuggerClass) {
+       public static final function createDebugMiddleware ($debuggerClass) {
                // Create an instance if this middleware
                $debugInstance = new DebugMiddleware();
 
@@ -79,10 +82,10 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
        /**
         * Getter for an instance of this class
         *
-        * @return      $thisInstance           An instance of this class
+        * @return      $selfInstance           An instance of this class
         */
-       public final static function getInstance() {
-               return self::$thisInstance;
+       public static final function getSelfInstance() {
+               return self::$selfInstance;
        }
 
        /**
@@ -100,18 +103,19 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         * browser or debug lines for a log file, etc. to the registered debug
         * output instance.
         *
-        * @param       $outStream      Data we shall "stream" out to the world
+        * @param       $outStream      Data we shall 'stream' out to the world
+        * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream) {
+       public final function output ($outStream, $stripTags = false) {
                // Is the output stream set
                if (empty($outStream)) {
-                       // Initialization phase
+                       // @TODO Initialization phase
                        return;
                } // END - if
 
                // Use the output instance
-               $this->outputInstance->outputStream($outStream);
+               $this->outputInstance->outputStream($outStream, $stripTags);
        }
 }