class_DebugErrorLogOutput.php

Go to the documentation of this file.
00001 <?php
00024 class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer {
00030         protected function __construct () {
00031                 // Call parent constructor
00032                 parent::__construct(__CLASS__);
00033         }
00034 
00040         public final static function createDebugErrorLogOutput () {
00041                 // Get a new instance
00042                 $debugInstance = new DebugErrorLogOutput();
00043 
00044                 // Return it
00045                 return $debugInstance;
00046         }
00047 
00054         public final function outputStream ($output) {
00055                 // Split multiple lines into and array to put them out line-by-line
00056                 $errorLines = explode("\n", $output);
00057                 foreach ($errorLines as $err) {
00058                         $err = trim($err);
00059                         // Log only none-empty lines
00060                         if (!empty($err)) {
00061                                 // Log this line
00062                                 error_log(html_entity_decode(strip_tags($err)), 0);
00063                         }
00064                 }
00065         }
00066 
00074         public final function assignVariable ($var, $value) {
00075                 // Empty stub!
00076                 trigger_error(__METHOD__.": Stub!");
00077         }
00078 
00084         public final function output ($outStream=false) {
00085                 // Empty output will be silently ignored
00086                 if ($outStream !== false) {
00087                         $this->outputStream($outStream);
00088                 }
00089         }
00090 }
00091 
00092 // [EOF]
00093 ?>

Generated on Mon Dec 8 01:06:45 2008 for Ship-Simulator by  doxygen 1.5.6