3 * A debug output class for PHP's error_log() command
5 class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer {
11 private function __construct () {
12 // Call parent constructor
13 parent::constructor(__CLASS__);
16 $this->setPartDescr("Debug-Ausgabe in error_log()");
18 // Create an unique ID
19 $this->createUniqueID();
23 * Creates an instance of this class
25 * @return $debugInstance The prepared debug instance
27 public final static function createDebugErrorLogOutput () {
29 $debugInstance = new DebugErrorLogOutput();
32 return $debugInstance;
36 * Outputs the given data without HTML tags
38 * @param $output The HTML'ed output
41 public final function outputStream ($output) {
42 // Split multiple lines into and array to put them out line-by-line
43 $errorLines = explode("\n", $output);
44 foreach ($errorLines as $err) {
46 // Log only none-empty lines
49 error_log(html_entity_decode(strip_tags($err)), 0);
55 * Assigns a variable for output
57 * @param $var The variable we shall assign
58 * @param $value The value to store in the variable
61 public final function assignVariable ($var, $value) {
62 trigger_error(__METHOD__.": Stub!");
70 public final function output ($outStream=false) {
71 // false will be silently ignored
72 if ($outStream !== false) {
73 $this->outputStream($outStream);