]> git.mxchange.org Git - hub.git/blob - ship-simu/inc/classes/main/debug/class_DebugConsoleOutput.php
Initial import
[hub.git] / ship-simu / inc / classes / main / debug / class_DebugConsoleOutput.php
1 <?php
2 /**
3  * A debug output class for the console (e.g. hub software)
4  */
5 class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer {
6         /**
7          * Private constructor
8          *
9          * @return      void
10          */
11         private function __construct () {
12                 // Call parent constructor
13                 parent::constructor(__CLASS__);
14
15                 // Set description
16                 $this->setPartDescr("Debug-Ausgabe auf Konsole");
17
18                 // Create an unique ID
19                 $this->createUniqueID();
20         }
21
22         /**
23          * Creates an instance of this class
24          *
25          * @return      $debugInstance          The prepared debug instance
26          */
27         public final static function createDebugConsoleOutput () {
28                 // Get a new instance
29                 $debugInstance = new DebugConsoleOutput();
30
31                 // Return it
32                 return $debugInstance;
33         }
34
35         /**
36          * Outputs the given data without HTML tags
37          *
38          * @param               $output The HTML'ed output
39          * @return      void
40          */
41         public final function outputStream ($output) {
42                 print html_entity_decode(strip_tags($output));
43         }
44
45         /**
46          * Outputs the given data without HTML tags
47          *
48          * @param               $output The HTML'ed output
49          * @return      void
50          */
51         public final function output ($outStream=false) {
52                 // false will be silently ignored
53                 if ($outStream !== false) {
54                         $this->outputStream($outStream);
55                 }
56         }
57
58         /**
59          * Assigns a variable for output
60          *
61          * @param               $var            The variable we shall assign
62          * @param               $value  The value to store in the variable
63          * @return      void
64          */
65         public final function assignVariable ($var, $value) {
66                 trigger_error(__METHOD__.": Stub!");
67         }
68 }
69
70 //
71 ?>