PHP Класс Jyxo\ErrorHandler

Автор: Jaroslav Hanslík
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( ) Constructor preventing from creating class instances.
exception ( Exception $exception, boolean $fire = true ) : boolean Adds a caught exception.
handleError ( integer $type, string $message, string $file, integer $line, array $context ) : boolean Handles errors and logs them.
handleException ( Exception $exception ) Catches exceptions and logs them.
handleFatalError ( ) Handles critical errors and logs them.
init ( boolean $debug = false ) Initializes error handling.
log ( array $message, boolean $fire = true ) : boolean Logs a message.
setErrorMail ( Jyxo\ErrorMail $errorMail ) Sets \Jyxo\ErrorMail instance for sending fatal error emails (used by the shutdown function and error handler).

Приватные методы

Метод Описание
firephp ( array $message ) : boolean Sends a message to FirePHP.
getAllPreviousExceptions ( Exception $exception ) : array Returns all exception's previous exceptions.
getTraceLog ( array $trace ) : string Returns trace log.

Описание методов

__construct() закрытый публичный Метод

Constructor preventing from creating class instances.
final public __construct ( )

exception() публичный статический Метод

Adds a caught exception.
public static exception ( Exception $exception, boolean $fire = true ) : boolean
$exception Exception Caught exception
$fire boolean Shall we use FirePHP?
Результат boolean

handleError() публичный статический Метод

Handles errors and logs them.
public static handleError ( integer $type, string $message, string $file, integer $line, array $context ) : boolean
$type integer Error type
$message string Error message
$file string File where the error occurred
$line integer Line on which the error occurred
$context array Error context variables
Результат boolean Was the error processed?

handleException() публичный статический Метод

Catches exceptions and logs them.
public static handleException ( Exception $exception )
$exception Exception Uncaught exception

handleFatalError() публичный статический Метод

Handles critical errors and logs them.
public static handleFatalError ( )

init() публичный статический Метод

Initializes error handling.
public static init ( boolean $debug = false )
$debug boolean Turn debugging on?

log() публичный статический Метод

Logs a message.
public static log ( array $message, boolean $fire = true ) : boolean
$message array Message definition
$fire boolean Shall we use FirePHP?
Результат boolean Was logging successful?

setErrorMail() публичный статический Метод

Sets \Jyxo\ErrorMail instance for sending fatal error emails (used by the shutdown function and error handler).
public static setErrorMail ( Jyxo\ErrorMail $errorMail )
$errorMail Jyxo\ErrorMail