PHP Класс PMA\libraries\Error

Наследование: extends Message
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$errorlevel array Error levels
$errortype array Error types

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

Свойство Тип Описание
$backtrace array Holds the backtrace for this error
$file string The file in which the error occurred
$hide_location Hide location of errors
$line integer The line in which the error occurred

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

Метод Описание
__construct ( integer $errno, string $errstr, string $errfile, integer $errline ) Constructor
formatBacktrace ( array $backtrace, string $separator, string $lines ) : string return formatted backtrace field
getArg ( string $arg, string $function ) : string Get a single function argument
getBacktrace ( integer $count ) : array returns PMA\libraries\Error::$_backtrace for first $count frames pass $count = -1 to get full backtrace.
getBacktraceDisplay ( ) : string Get HTML backtrace
getDisplay ( ) : string Gets the error as string of HTML
getFile ( ) : string returns PMA\libraries\Error::$file
getFunctionCall ( array $step, string $separator ) : string Formats function call in a backtrace
getHash ( ) : string returns unique PMA\libraries\Error::$hash, if not exists it will be created
getHtmlTitle ( ) : string returns title prepared for HTML Title-Tag
getLevel ( ) : string returns level of error
getLine ( ) : integer returns PMA\libraries\Error::$line
getTitle ( ) : string returns title for error
getType ( ) : string returns type of error
isUserError ( ) : boolean whether this error is a user error
processBacktrace ( array $backtrace ) : array Process backtrace to avoid path disclossures, objects and so on
relPath ( string $path ) : string return short relative path to phpMyAdmin basedir
setBacktrace ( array $backtrace ) : void sets PMA\libraries\Error::$_backtrace
setFile ( string $file ) : void sets PMA\libraries\Error::$_file
setHideLocation ( boolean $hide ) : void Toggles location hiding
setLine ( integer $line ) : void sets PMA\libraries\Error::$_line

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

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

Constructor
public __construct ( integer $errno, string $errstr, string $errfile, integer $errline )
$errno integer error number
$errstr string error message
$errfile string file
$errline integer line

formatBacktrace() публичный статический Метод

return formatted backtrace field
public static formatBacktrace ( array $backtrace, string $separator, string $lines ) : string
$backtrace array Backtrace data
$separator string Arguments separator to use
$lines string Lines separator to use
Результат string formatted backtrace

getArg() публичный статический Метод

if $function is one of include/require the $arg is converted to a relative path
public static getArg ( string $arg, string $function ) : string
$arg string argument to process
$function string function name
Результат string

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

The same can be done by not passing $count at all.
public getBacktrace ( integer $count ) : array
$count integer Number of stack frames.
Результат array PMA\libraries\Error::$_backtrace

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

Get HTML backtrace
public getBacktraceDisplay ( ) : string
Результат string

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

Gets the error as string of HTML
public getDisplay ( ) : string
Результат string

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

returns PMA\libraries\Error::$file
public getFile ( ) : string
Результат string PMA\libraries\Error::$file

getFunctionCall() публичный статический Метод

Formats function call in a backtrace
public static getFunctionCall ( array $step, string $separator ) : string
$step array backtrace step
$separator string Arguments separator to use
Результат string

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

returns unique PMA\libraries\Error::$hash, if not exists it will be created
public getHash ( ) : string
Результат string PMA\libraries\Error::$hash

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

returns title prepared for HTML Title-Tag
public getHtmlTitle ( ) : string
Результат string HTML escaped and truncated title

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

returns level of error
public getLevel ( ) : string
Результат string level of error

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

returns PMA\libraries\Error::$line
public getLine ( ) : integer
Результат integer PMA\libraries\Error::$line

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

returns title for error
public getTitle ( ) : string
Результат string

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

returns type of error
public getType ( ) : string
Результат string type of error

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

whether this error is a user error
public isUserError ( ) : boolean
Результат boolean

processBacktrace() публичный статический Метод

Process backtrace to avoid path disclossures, objects and so on
public static processBacktrace ( array $backtrace ) : array
$backtrace array backtrace
Результат array

relPath() публичный статический Метод

prevent path disclosure in error message, and make users feel safe to submit error reports
public static relPath ( string $path ) : string
$path string path to be shorten
Результат string shortened path

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

We don't store full arguments to avoid wakeup or memory problems.
public setBacktrace ( array $backtrace ) : void
$backtrace array backtrace
Результат void

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

sets PMA\libraries\Error::$_file
public setFile ( string $file ) : void
$file string the file
Результат void

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

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

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

sets PMA\libraries\Error::$_line
public setLine ( integer $line ) : void
$line integer the line
Результат void

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

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

Holds the backtrace for this error
protected array $backtrace
Результат array

$errorlevel публичное статическое свойство

Error levels
public static array $errorlevel
Результат array

$errortype публичное статическое свойство

Error types
public static array $errortype
Результат array

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

The file in which the error occurred
protected string $file
Результат string

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

Hide location of errors
protected $hide_location

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

The line in which the error occurred
protected int $line
Результат integer