XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
|
Public Member Functions | |
__construct () | |
activate ($showErrors=false) | |
handleError ($error) | |
renderErrors () | |
Static Public Member Functions | |
static & | getInstance () |
Data Fields | |
$_errors = [] | |
$_showErrors = false | |
$_isFatal = false | |
Definition at line 16 of file errorhandler.php.
__construct | ( | ) |
Constructor
Registers the error handler and shutdown functions. NOTE: when registering an error handler, the setting or 'error_reporting' is ignored and everything is trapped.
Definition at line 49 of file errorhandler.php.
activate | ( | $showErrors = false | ) |
Activate the error handler
@access public
bool | $showErrors | True if debug mode is on |
Definition at line 76 of file errorhandler.php.
|
static |
Get the (singleton) instance of the error handler
@access public
Definition at line 60 of file errorhandler.php.
handleError | ( | $error | ) |
Handle an error
array | $error | Associative array containing error info @access public |
Definition at line 88 of file errorhandler.php.
renderErrors | ( | ) |
Render the list of errors
NOTE: Unfortunately PHP 'fatal' and 'parse' errors are not trappable. If the server has 'display_errors Off', then the result will be a blank page. It would be nice to print a message 'This page cannot be displayed', but there seems to be no way to print this only when exiting due to a fatal error rather than normal end of page.
Thus, 'trigger_error' should be used to trap problems early and display a meaningful message before a PHP fatal or parse error can occur.
@TODO Use CSS @TODO Use language? or allow customized message?
@access public
Definition at line 119 of file errorhandler.php.
$_errors = [] |
Definition at line 24 of file errorhandler.php.
$_isFatal = false |
Definition at line 40 of file errorhandler.php.
$_showErrors = false |
Definition at line 32 of file errorhandler.php.