forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispatch.php
More file actions
49 lines (39 loc) · 1.01 KB
/
Copy pathdispatch.php
File metadata and controls
49 lines (39 loc) · 1.01 KB
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
<?php
function error_dumper($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno)) {
return;
}
$log = fopen('/tmp/vesta.php.log', 'a+');
switch ($errno) {
case E_USER_ERROR:
$o = "ERROR: [$errno] $errstr\n";
$o.= " Fatal error on line $errline in file $errfile";
$o.= ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n";
$o.= "Aborting...\n";
fwrite($log, $o);
fclose($log);
exit(1);
break;
case E_USER_WARNING:
$o = "WARNING: [$errno] $errstr\n";
fwrite($log, $o);
fclose($log);
break;
case E_USER_NOTICE:
$o = "NOTICE: [$errno] $errstr\n";
fwrite($log, $o);
fclose($log);
break;
default:
$o = "Unknown error type: [$errno] $errstr\n";
fwrite($log, $o);
fclose($log);
break;
}
/* Don't execute PHP internal error handler */
return true;
}
set_error_handler('error_dumper');
require dirname(__FILE__).DIRECTORY_SEPARATOR.'vesta/app.init.php';
?>