public function handleError($errorCode, $errorMessage, $errorFile, $errorLine, $application = null)
{
if (ob_get_level() > 0) {
ob_end_clean();
}
if (self::$_showActive) {
echo $errorMessage;
return false;
}
if (!(error_reporting() & $errorCode)) {
return false;
}
self::$_showActive = true;
header("Content-type: text/html");
echo '<html><head><title>Exception - ', $errorMessage, '</title>', $this->getCssSources(), '</head><body>';
echo '<div class="error-main">
', $errorMessage, '
<br/><span class="error-file">', $errorFile, ' (', $errorLine, ')</span>
</div>';
if ($this->_showBackTrace) {
echo '<div class="error-backtrace"><table cellspacing="0">';
foreach (debug_backtrace() as $n => $trace) {
if ($n == 0) {
continue;
}
$this->_showTraceItem($n, $trace);
}
echo '</table></div>';
}
$this->showApplicationDump($application);
echo $this->getVersion();
echo $this->getJsSources() . '</body></html>';
self::$_showActive = false;
return true;
}