Public Member Functions | |
XoopsErrorHandler () | |
& | getInstance () |
activate ($showErrors=false) | |
handleError ($error) | |
renderErrors () |
XoopsErrorHandler::XoopsErrorHandler | ( | ) |
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.
& XoopsErrorHandler::getInstance | ( | ) |
Get the (singleton) instance of the error handler
public
XoopsErrorHandler::activate | ( | $ | showErrors = false |
) |
Activate the error handler
public
boolean | $showErrors True if debug mode is on |
XoopsErrorHandler::handleError | ( | $ | error | ) |
Handle an error
array | $error Associative array containing error info public |
XoopsErrorHandler::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.
Use CSS Use language? or allow customized message?
public