Friday, December 14, 2012
php catching fatal errors
Source
register_shutdown_function('handleShutdown');
function handleShutdown() {
$error = error_get_last();
if($error !== NULL){
$info = "[SHUTDOWN] file:".$error['file']." | ln:".$error['line']." | msg:".$error['message'] .PHP_EOL;
yourPrintOrMailFunction($info);
}
else{
yourPrintOrMailFunction("SHUTDOWN");
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment