]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/debug/class_DebugWebOutput.php
Added stripTags (default: false) to allow stripping out HTML tags
[core.git] / inc / classes / main / debug / class_DebugWebOutput.php
index 493463a1aefb2f221cfd35e7995dcf5b6a381a81..2d931db4da476a042dcda8408a6591f4f94de57e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
+ * @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
  *
@@ -46,12 +46,13 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre
        }
 
        /**
-        * Outputs the given data directly
+        * Outputs the given data directly, ignores $stripTags
         *
         * @param       $output         The HTML output
+        * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function outputStream ($output) {
+       public final function outputStream ($output, $stripTags = false) {
                // Strip out <br />
                $output = str_replace("<br />", '', $output);
                print(stripslashes($output)."<br />\n");
@@ -60,13 +61,27 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre
        /**
         * Output the code
         *
+        * @param       $outStream      Stream to output
+        * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = false) {
+       public final function output ($outStream = false, $stripTags = false) {
                // Empty output will be silently ignored
                if ($outStream !== false) {
-                       $this->outputStream($outStream);
-               }
+                       $this->outputStream($outStream, $stripTags);
+               } // END - if
+       }
+
+       /**
+        * Streams the data and maybe does something to it
+        *
+        * @param       $data   The data (string mostly) to "stream"
+        * @return      $data   The data (string mostly) to "stream"
+        * @throws      UnsupportedOperationException   If this method is called
+        */
+       public function streamData ($data) {
+               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }