|
|
@ -1,4 +1,4 @@ |
|
|
|
<?php |
|
|
|
<?php namespace Majestic\Exception; |
|
|
|
/** |
|
|
|
* @copyright NetMonsters <team@netmonsters.ru> |
|
|
|
* @link http://netmonsters.ru |
|
|
@ -22,7 +22,7 @@ class ErrorHandler |
|
|
|
ob_end_clean(); |
|
|
|
} |
|
|
|
if (error_reporting() !== 0) { |
|
|
|
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); |
|
|
|
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@ -31,7 +31,7 @@ class ErrorHandler |
|
|
|
{ |
|
|
|
$error = 0; |
|
|
|
$exception_name = ''; |
|
|
|
if ($exception instanceof ErrorException) { |
|
|
|
if ($exception instanceof \ErrorException) { |
|
|
|
$error = $exception->getSeverity(); |
|
|
|
} else { |
|
|
|
$exception_name = get_class($exception) . ': '; |
|
|
@ -59,9 +59,9 @@ class ErrorHandler |
|
|
|
static public function getHTTPErrorConditions() |
|
|
|
{ |
|
|
|
$text = null; |
|
|
|
if (!is_null(Env::Server('REQUEST_METHOD')) && !is_null(Env::Server('REQUEST_URI'))) { |
|
|
|
$text = ', URL: ' . Env::Server('REQUEST_METHOD') . ' ' . Env::Server('REQUEST_URI'); |
|
|
|
$text .= ', referrer: ' . Env::Server('HTTP_REFERER'); |
|
|
|
if (!is_null(\Majestic\Env::Server('REQUEST_METHOD')) && !is_null(\Majestic\Env::Server('REQUEST_URI'))) { |
|
|
|
$text = ', URL: ' . \Majestic\Env::Server('REQUEST_METHOD') . ' ' . \Majestic\Env::Server('REQUEST_URI'); |
|
|
|
$text .= ', referrer: ' . \Majestic\Env::Server('HTTP_REFERER'); |
|
|
|
} |
|
|
|
return $text; |
|
|
|
} |
|
|
@ -109,7 +109,7 @@ class ErrorHandler |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param Exception $exception |
|
|
|
* @param \Exception $exception |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
static public function showDebug($exception) |
|
|
@ -120,19 +120,19 @@ class ErrorHandler |
|
|
|
} |
|
|
|
$class = get_class($exception); |
|
|
|
|
|
|
|
$method = Env::Server('REQUEST_METHOD', ''); |
|
|
|
$uri = Env::getRequestUri(); |
|
|
|
$method = \Majestic\Env::Server('REQUEST_METHOD', ''); |
|
|
|
$uri = \Majestic\Env::getRequestUri(); |
|
|
|
$source = self::getSource($exception->getFile(), $exception->getLine()); |
|
|
|
$time = date('r', Env::Server('REQUEST_TIME', time())); |
|
|
|
$time = date('r', \Majestic\Env::Server('REQUEST_TIME', time())); |
|
|
|
|
|
|
|
$trace = nl2br($exception->getTraceAsString()); |
|
|
|
|
|
|
|
$get = self::wrapArray(Env::Get(), 'GET'); |
|
|
|
$post = self::wrapArray(Env::Post(), 'POST'); |
|
|
|
$session = self::wrapArray(Session::get(), 'SESSION'); |
|
|
|
$files = self::wrapArray(Env::Files(), 'FILES'); |
|
|
|
$cookies = self::wrapArray(Env::Cookie(), 'COOKIE'); |
|
|
|
$server = self::wrapArray(Env::Server(), 'SERVER'); |
|
|
|
$get = self::wrapArray(\Majestic\Env::Get(), 'GET'); |
|
|
|
$post = self::wrapArray(\Majestic\Env::Post(), 'POST'); |
|
|
|
$session = self::wrapArray(\Majestic\Session\Session::get(), 'SESSION'); |
|
|
|
$files = self::wrapArray(\Majestic\Env::Files(), 'FILES'); |
|
|
|
$cookies = self::wrapArray(\Majestic\Env::Cookie(), 'COOKIE'); |
|
|
|
$server = self::wrapArray(\Majestic\Env::Server(), 'SERVER'); |
|
|
|
|
|
|
|
$message = <<<EOD |
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |