-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror_critic.php
More file actions
38 lines (36 loc) · 853 Bytes
/
Copy patherror_critic.php
File metadata and controls
38 lines (36 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
if(!defined('INITIALIZED'))
exit;
class Error_Critic
{
public function __construct($id = '', $text = '', $errors = array())
{
echo '<h3>Error occured!</h3>';
echo 'Error ID: <b>' . $id . '</b><br />';
echo 'More info: <b>' . $text . '</b><br />';
if(count($errors) > 0)
{
echo 'Errors list:<br />';
foreach($errors as $error)
echo '<li>' . $error->getId() . ' - ' . $error->getText() . '</li>';
}
function showErrorBacktrace($a, $b)
{
print "<br />File: <b>";
if(isset($a['file']))
{
print dirname($a['file']) . "/" . basename($a['file']);
}
else
{
print 'Unknown';
}
print "</b> Line: <font color=\"red\">";
print ((isset($a['line'])) ? $a['line'] : 'Unknown');
print "</font>";
}
$tmp = debug_backtrace();
array_walk( $tmp, "showErrorBacktrace" );
exit;
}
}