PHP Класс PMA\libraries\ErrorHandler

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$errors Error[] ..
$hide_location Hide location of errors

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

Метод Описание
__construct ( ) Constructor - set PHP error handler
__destruct ( ) Destructor
addError ( string $errstr, integer $errno, string $errfile, integer $errline, boolean $escape = true ) : void Add an error; can also be called directly (with or without escaping)
countDisplayErrors ( ) : integer number of errors to be displayed
countErrors ( boolean $check = true ) : integer return count of errors
countUserErrors ( ) : integer return count of user errors
dispErrors ( ) : void displays errors not displayed
dispUserErrors ( ) : void Displays user errors not displayed
getCurrentErrors ( ) : Error[] returns the errors occurred in the current run only.
getDispErrors ( ) : string renders errors not displayed
getDispUserErrors ( ) : string Renders user errors not displayed
getErrors ( boolean $check = true ) : Error[] returns array with all errors
handleError ( integer $errno, string $errstr, string $errfile, integer $errline ) : void Error handler - called when errors are triggered/occurred
hasDisplayErrors ( ) : boolean whether there are errors to display or not
hasErrors ( ) : boolean whether errors occurred or not
hasErrorsForPrompt ( ) : boolean Function to check if there are any errors to be prompted.
hasUserErrors ( ) : boolean whether use errors occurred or not
reportErrors ( ) : void Function to report all the collected php errors.
savePreviousErrors ( ) : void Deletes previously stored errors in SESSION.
setHideLocation ( boolean $hide ) : void Toggles location hiding
sliceErrors ( integer $count ) : Error[] Pops recent errors from the storage
triggerError ( string $errorInfo, integer $errorNumber = null ) : void trigger a custom error

Защищенные методы

Метод Описание
checkSavedErrors ( ) : void look in session for saved errors
dispFatalError ( Error $error ) : void display fatal error and exit
dispPageEnd ( ) : void display HTML footer
dispPageStart ( Error $error = null ) : void display HTML header

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

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

Constructor - set PHP error handler
public __construct ( )

__destruct() публичный Метод

stores errors in session
public __destruct ( )

addError() публичный Метод

The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called. Do not use the context parameter as we want to avoid storing the complete $GLOBALS inside $_SESSION['errors']
public addError ( string $errstr, integer $errno, string $errfile, integer $errline, boolean $escape = true ) : void
$errstr string error string
$errno integer error number
$errfile string error file
$errline integer error line
$escape boolean whether to escape the error string
Результат void

checkSavedErrors() защищенный Метод

look in session for saved errors
protected checkSavedErrors ( ) : void
Результат void

countDisplayErrors() публичный Метод

number of errors to be displayed
public countDisplayErrors ( ) : integer
Результат integer number of errors to be displayed

countErrors() публичный Метод

return count of errors
public countErrors ( boolean $check = true ) : integer
$check boolean Whether to check for session errors
Результат integer number of errors occurred

countUserErrors() публичный Метод

return count of user errors
public countUserErrors ( ) : integer
Результат integer number of user errors occurred

dispErrors() публичный Метод

displays errors not displayed
public dispErrors ( ) : void
Результат void

dispFatalError() защищенный Метод

display fatal error and exit
protected dispFatalError ( Error $error ) : void
$error Error the error
Результат void

dispPageEnd() защищенный Метод

display HTML footer
protected dispPageEnd ( ) : void
Результат void

dispPageStart() защищенный Метод

display HTML header
protected dispPageStart ( Error $error = null ) : void
$error Error the error
Результат void

dispUserErrors() публичный Метод

Displays user errors not displayed
public dispUserErrors ( ) : void
Результат void

getCurrentErrors() публичный Метод

Does not include the errors saved in the SESSION
public getCurrentErrors ( ) : Error[]
Результат Error[]

getDispErrors() публичный Метод

renders errors not displayed
public getDispErrors ( ) : string
Результат string

getDispUserErrors() публичный Метод

Renders user errors not displayed
public getDispUserErrors ( ) : string
Результат string

getErrors() публичный Метод

returns array with all errors
public getErrors ( boolean $check = true ) : Error[]
$check boolean Whether to check for session errors
Результат Error[]

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

This calls the addError() function, escaping the error string Ignores the errors wherever Error Control Operator (@) is used.
public handleError ( integer $errno, string $errstr, string $errfile, integer $errline ) : void
$errno integer error number
$errstr string error string
$errfile string error file
$errline integer error line
Результат void

hasDisplayErrors() публичный Метод

whether there are errors to display or not
public hasDisplayErrors ( ) : boolean
Результат boolean

hasErrors() публичный Метод

whether errors occurred or not
public hasErrors ( ) : boolean
Результат boolean

hasErrorsForPrompt() публичный Метод

Needed because user warnings raised are also collected by global error handler. This distinguishes between the actual errors and user errors raised to warn user.
public hasErrorsForPrompt ( ) : boolean
Результат boolean true if there are errors to be "prompted", false otherwise

hasUserErrors() публичный Метод

whether use errors occurred or not
public hasUserErrors ( ) : boolean
Результат boolean

reportErrors() публичный Метод

Must be called at the end of each script by the $GLOBALS['error_handler'] only.
public reportErrors ( ) : void
Результат void

savePreviousErrors() публичный Метод

Saves current errors in session as previous errors. Required to save current errors in case 'ask'
public savePreviousErrors ( ) : void
Результат void

setHideLocation() публичный Метод

Toggles location hiding
public setHideLocation ( boolean $hide ) : void
$hide boolean Whether to hide
Результат void

sliceErrors() публичный Метод

Pops recent errors from the storage
public sliceErrors ( integer $count ) : Error[]
$count integer Old error count
Результат Error[]

triggerError() публичный Метод

trigger a custom error
public triggerError ( string $errorInfo, integer $errorNumber = null ) : void
$errorInfo string error message
$errorNumber integer error number
Результат void

Описание свойств

$errors защищенное свойство

..
protected Error[],PMA\libraries $errors
Результат Error[]

$hide_location защищенное свойство

Hide location of errors
protected $hide_location