PHP Class Jyxo\ErrorHandler

Author: Jaroslav Hanslík
Afficher le fichier Open project: jyxo/php

Méthodes publiques

Méthode Description
__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).

Private Methods

Méthode Description
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.

Method Details

__construct() final public méthode

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

exception() public static méthode

Adds a caught exception.
public static exception ( Exception $exception, boolean $fire = true ) : boolean
$exception Exception Caught exception
$fire boolean Shall we use FirePHP?
Résultat boolean

handleError() public static méthode

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
Résultat boolean Was the error processed?

handleException() public static méthode

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

handleFatalError() public static méthode

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

init() public static méthode

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

log() public static méthode

Logs a message.
public static log ( array $message, boolean $fire = true ) : boolean
$message array Message definition
$fire boolean Shall we use FirePHP?
Résultat boolean Was logging successful?

setErrorMail() public static méthode

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