entries[] = array($severity, $line); } function log_phperror($errno, $errstr, $errfile, $errline) { switch($errno) { case E_WARNING: $errno = self::WARN; break; case E_NOTICE: $errno = self::NOTICE; break; default: $errno = self::WARN; break; } $this->log("Error on line $errline in file $errfile:\n
".htmlspecialchars($errstr)."", $errno); /* Don't execute PHP internal error handler */ return true; } function php_shutdown() { if(!$this->is_empty()) { // we still have errors. print them! $this->print_all('final shutdown'); } } function is_empty() { return empty($this->entries); } function print_all($ul_classes='') { // causal printing function. Flushes entries afterwards! // if $ul_classes is given, will print a list around if($ul_classes) print "