PHP Class MY_Exceptions, 68kb

Inheritance: extends CI_Exceptions
Datei anzeigen Open project: 68kb/68kb Class Usage Examples

Public Properties

Property Type Description
$php_errors Some nice names for the error types
$shutdown_errors The Shutdown errors to show (all others will be ignored).

Public Methods

Method Description
__construct ( ) : void Construct
debug_path ( string $file ) : string Debug Path
debug_source ( $file, $line_number, $padding = 5 ) : FALSE Debug Source
error_handler ( $code, $error, $file = NULL, $line = NULL ) : boolean Error Handler
exception_handler ( Exception $e ) : boolean Exception Handler
exception_text ( Exception $e ) : string Exception Text
show_error ( $heading, $message, $template = 'error_general', $status_code = 500 ) : string General Error Page
shutdown_handler ( ) : void Shutdown Handler
trace ( array $trace = NULL ) : string Trace

Private Methods

Method Description
is_extension ( string $file ) : boolean Is Extension

Method Details

__construct() public method

Sets the error handlers.
public __construct ( ) : void
return void

debug_path() public static method

This makes nicer looking paths for the error output.
public static debug_path ( string $file ) : string
$file string
return string

debug_source() public static method

Returns an HTML string, highlighting a specific line of a file, with some number of lines padded above and below.
public static debug_source ( $file, $line_number, $padding = 5 ) : FALSE
return FALSE source of file

error_handler() public static method

Converts all errors into ErrorExceptions. This handler respects error_reporting settings.
public static error_handler ( $code, $error, $file = NULL, $line = NULL ) : boolean
return boolean

exception_handler() public static method

Displays the error message, source of the exception, and the stack trace of the error.
public static exception_handler ( Exception $e ) : boolean
$e Exception
return boolean

exception_text() public static method

Makes a nicer looking, 1 line extension.
public static exception_text ( Exception $e ) : string
$e Exception
return string

show_error() public method

This function takes an error message as input (either as a string or an array) and displays it using the specified template.
public show_error ( $heading, $message, $template = 'error_general', $status_code = 500 ) : string
return string

shutdown_handler() public static method

Catches errors that are not caught by the error handler, such as E_PARSE.
public static shutdown_handler ( ) : void
return void

trace() public static method

Returns an array of HTML strings that represent each step in the backtrace.
public static trace ( array $trace = NULL ) : string
$trace array
return string

Property Details

$php_errors public_oe static_oe property

Some nice names for the error types
public static $php_errors

$shutdown_errors public_oe static_oe property

The Shutdown errors to show (all others will be ignored).
public static $shutdown_errors