-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebug.php
More file actions
34 lines (27 loc) · 764 Bytes
/
Debug.php
File metadata and controls
34 lines (27 loc) · 764 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
<?php
class Debug
{
public static function dump($data, $var_dump = false, $exit = false, $exit_text = '', $hide = false, $backtrace = false)
{
$style = 'color: #DD1144;';
if ($hide) {
$style .= 'display: none;';
}
print '<pre class="debug" style="' . $style . '">';
print 'value:';
print PHP_EOL;
if ($var_dump) {
var_dump($data);
} else {
print_r($data);
}
if ($backtrace) {
print PHP_EOL;
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
}
print '</pre>';
if ($exit) {
exit($exit_text);
}
}
}