<?php
// set to the user defined error handler
$old_error_handler = set_error_handler("myErrorHandler");
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
if ($errno == 8) {
return;
}
$message =
"Website ERROR [$errno] $errstr
Fatal error on line $errline in file $errfile
, PHP " . PHP_VERSION . " (" . PHP_OS . ")
Aborting...";
$to = 'jclark@pugbot.com';
$subject = 'PUGBOT Website Error';
$headers = 'From: noreply@pugbot.com' . "\r\n" .
'Reply-To: noreply@pugbot.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
return true;
}
?>