- $errstr = utf8_encode(htmlentities($errstr));
- $GLOBALS['pl_errors'][] =
- "<div class='phperror'>".
- "<strong>{$type}</strong> <em>$errstr</em><br />".
- "<tt>$errfile : $errline</tt>".
- "</div>";
-}
-
-function pl_clear_errors()
-{
- unset($GLOBALS['pl_errors']);
+ $error = strpos($type, 'Warning') !== false || strpos($type, 'Error') !==false;
+ if (!isset(PlBacktrace::$bt['PHP Errors'])) {
+ new PlBacktrace('PHP Errors');
+ }
+ PlBacktrace::$bt['PHP Errors']->newEvent("$type: $errstr",
+ 0, $error ? $errstr : null,
+ array(array('file' => $errfile,
+ 'line' => $errline)));