-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmmexchdl.php
77 lines (64 loc) · 1.73 KB
/
mmexchdl.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php // mmexchdl.php
use mondrakeNG\mm\core\MMDiag;
function exception_handler($exception) {
$errMsg = 'Code: ' . $exception->getCode() . ' - Message: ' . $exception->getMessage(). '<br/><br/>';
echo $errMsg;
echo <<<_END
<!-- The HTML section -->
<style>.signup { border: 1px solid #999999;
font: normal 10px verdana; color:#444444; }</style>
</head><body>
<table class="signup" border="1" cellpadding="2"
cellspacing="0" bgcolor="#eeeeee">
<tr>
<th>Class</th>
<th>Time</th>
<th>Severity</th>
<th>Id</th>
<th>Message</th>
<th>Elapsed</th>
</tr>
_END;
$obj = new MMDiag;
foreach ($obj->get() as $msg) {
echo "<tr>";
echo "<td>$msg->className</td>";
echo "<td>$msg->time</td>";
echo "<td align=center><img src='resources/$msg->severity.png' alt='$msg->severity'/></td>";
echo "<td>$msg->id</td>";
echo "<td>$msg->fullText</td>";
$roundElapsed = $msg->elapsed ? round($msg->elapsed, 5) : '-';
echo "<td>$roundElapsed</td>";
echo "</tr>";
}
echo <<<_END
</table><br/><br/>
<table class="signup" border="1" cellpadding="2"
cellspacing="0" bgcolor="#eeeeee">
<tr>
<th>#</th>
<th>Function</th>
<th>File</th>
<th>Line</th>
<th>Args</th>
</tr>
_END;
$trace = $exception->getTrace();
foreach ($trace as $n => $msg) {
//print_r($msg);
// echo "$msg->className - $msg->severity - [$msg->id] - $msg->fullText <br/>";
echo "<tr>";
echo "<td>$n</td>";
echo "<td>$msg[class]$msg[type]$msg[function]</td>";
// echo "<td>$msg[type]</td>";
// echo "<td>$msg[function]</td>";
echo "<td>$msg[file]</td>";
echo "<td>$msg[line]</td>";
echo "<td>.</td>";
echo "</tr>";
}
// print_r($trace);
die;
// echo "Uncaught exception: " , $exception->getMessage(), "\n";
}
set_exception_handler('exception_handler');