Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/utility/logger.php
Show First 20 Lines • Show All 781 Lines • ▼ Show 20 Line(s) | |||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function catchLastError() | public function catchLastError() | ||||
{ | { | ||||
$this->write(); | $this->write(); | ||||
$last_error = error_get_last(); | $last_error = error_get_last(); | ||||
if ( !is_null($last_error) && isset($this->_handlers[self::LL_ERROR]) ) { | if ( !is_null($last_error) && isset($this->_handlers[self::LL_ERROR]) ) { | ||||
/** @var kErrorHandlerStack $handler */ | |||||
$handler = $this->_handlers[self::LL_ERROR]; | $handler = $this->_handlers[self::LL_ERROR]; | ||||
/* @var $handler kErrorHandlerStack */ | |||||
$handler->handle($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']); | $handler->handle($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Deletes log with given id from database or disk, when database isn't available | * Deletes log with given id from database or disk, when database isn't available | ||||
* | * | ||||
▲ Show 20 Lines • Show All 584 Lines • ▼ Show 20 Line(s) | |||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function handle($exception) | public function handle($exception) | ||||
{ | { | ||||
$log = $this->_logger->prepare()->addException($exception); | $log = $this->_logger->prepare()->addException($exception); | ||||
if ( $exception instanceof kRedirectException ) { | if ( $exception instanceof kRedirectException ) { | ||||
/* @var $exception kRedirectException */ | /** @var kRedirectException $exception */ | ||||
$exception->run(); | $exception->run(); | ||||
} | } | ||||
if ( $this->_handleFatalError($exception) ) { | if ( $this->_handleFatalError($exception) ) { | ||||
$log->write(); | $log->write(); | ||||
return true; | return true; | ||||
Show All 13 Lines |