<?php
//namespace mocovi;
header ("HTTP/1.1 500 Internal Server Error");
$out->clear();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>PHP Exception</title>
</head>
<body>
<h4><?php echo get_class($e).' '.date('Ymd-His');?>:</h4>
<p><a href="#error_anchor" title="Jump to error"><?php echo $e->getFile();?>:<?php echo $e->getLine();?></a></p>
<div style="border: 1px dashed red; padding: 1em; background-color: #ffeeee;">
<h2><?php echo $e->getMessage();?></h2>
<?php
$ex = $e;
//while($ex = $ex->getPrevious()) // getPrevious available since PHP 5.3
{
?>
<div><?php echo $ex->getMessage(); ?></div>
<?php
}
?>
</div>
<dl style="color: red; border: 1px dashed red; padding: 1em;">
<dt><h4>Stacktrace:</h4></dt>
<dd><pre><?php echo $e->getTraceAsString();?></pre></dd>
</dl>
<dl>
<dt><h3>Source Code:</h3></dt>
<dd>
<code>
<ol style="display: block; padding: 10px 40px; border: 1px dashed grey; background-color: #f8f8f8; font-family: courier, monotype, sans-serif;">
<?php
$fileArray = explode("<br />", highlight_file($e->getFile(), 1));
for($i = 0; $i < count($fileArray); $i++)
$out->append("<li" . ($i == $e->getLine() - 1 ? ' style="background-color: #ff8888;"><a name="error_anchor" /"' : '') . ">" . $fileArray[$i] . "</li>\n");
echo $out;
?>
</ol>
</code>
</dd>
</dl>
</body>
</html>