1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-05 20:57:49 +02:00

Update Gelato to 1.0.1

This commit is contained in:
Awilum
2013-03-05 23:15:28 +02:00
parent a464d2bff5
commit 7433dbd24c
6 changed files with 86 additions and 68 deletions

View File

@@ -18,6 +18,25 @@
class ErrorHandler
{
/**
* Error Levels
*/
public static $levels = array (
E_ERROR => 'Fatal Error',
E_PARSE => 'Parse Error',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_STRICT => 'Strict Mode Error',
E_NOTICE => 'Notice',
E_WARNING => 'Warning',
E_RECOVERABLE_ERROR => 'Recoverable Error',
E_USER_NOTICE => 'Notice',
E_USER_WARNING => 'Warning',
E_USER_ERROR => 'Error',
/*E_DEPRECATED => 'Deprecated',*/ /* PHP 5.3 only */
/*E_USER_DEPRECATED => 'Deprecated'*/ /* PHP 5.3 only */
);
/**
* Protected constructor since this is a static class.
*
@@ -194,7 +213,7 @@ class ErrorHandler
if (isset($entry['file'])) {
$location['file'] = $entry['file'];
$location['line'] = $entry['line'];
$location['code'] = static::highlightCode($entry['file'], $entry['line']);
$location['code'] = self::highlightCode($entry['file'], $entry['line']);
}
/**
@@ -247,24 +266,7 @@ class ErrorHandler
// Determine error type
if ($exception instanceof ErrorException) {
$error['type'] = 'ErrorException: ';
$codes = array (
E_ERROR => 'Fatal Error',
E_PARSE => 'Parse Error',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_STRICT => 'Strict Mode Error',
E_NOTICE => 'Notice',
E_WARNING => 'Warning',
E_RECOVERABLE_ERROR => 'Recoverable Error',
/*E_DEPRECATED => 'Deprecated',*/
E_USER_NOTICE => 'Notice',
E_USER_WARNING => 'Warning',
E_USER_ERROR => 'Error',
/*E_USER_DEPRECATED => 'Deprecated'*/
);
$error['type'] .= in_array($error['code'], array_keys($codes)) ? $codes[$error['code']] : 'Unknown Error';
$error['type'] .= in_array($error['code'], array_keys(ErrorHandler::$levels)) ? ErrorHandler::$levels[$error['code']] : 'Unknown Error';
} else {
$error['type'] = get_class($exception);
}
@@ -283,8 +285,8 @@ class ErrorHandler
$error['backtrace'] = array_slice($error['backtrace'], 1); //Remove call to error handler from backtrace
}
$error['backtrace'] = static::formatBacktrace($error['backtrace']);
$error['highlighted'] = static::highlightCode($error['file'], $error['line']);
$error['backtrace'] = self::formatBacktrace($error['backtrace']);
$error['highlighted'] = self::highlightCode($error['file'], $error['line']);
Response::status(500);
include 'Resources/Views/Errors/exception.php';