Created
November 13, 2013 14:57
-
-
Save asgrim/f7180c73aacebfb8b715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (is_null($lastError)) | |
{ | |
$lastError = error_get_last(); | |
if (null === $lastError || $lastError['message'] == '') | |
{ | |
return false; | |
} | |
} | |
$errors = array(E_ERROR, E_USER_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, E_STRICT); | |
if (in_array($lastError['type'], $errors)) | |
{ | |
$message = isset($lastError['message']) ? $lastError['message'] : ''; | |
$code = isset($lastError['type']) ? $lastError['type'] : E_ERROR; | |
$file = isset($lastError['file']) ? $lastError['file'] : ''; | |
$line = isset($lastError['line']) ? $lastError['line'] : 0; | |
// We shouldn't call the previous error handler if shutting down | |
unset ($this->previousErrorHandler); | |
$this->handleError($code, $message, $file, $line); | |
return true; | |
} | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment