Class: PEAR_ErrorStack
Source Location: /PEAR-1.10.12/PEAR/ErrorStack.php
Error Stack Implementation
Author(s):
Version:
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 231]
PEAR_ErrorStack __construct(
string
$package, [callback
$msgCallback = false], [callback
$contextCallback = false], [boolean
$throwPEAR_Error = false])
|
|
Set up a new error stack
Parameters:
getErrorMessage [line 903]
string getErrorMessage(
PEAR_ErrorStack
&$stack, array
$err, [string|false
$template = false])
|
|
Standard error message generation callback This method may also be called by a custom error message generator to fill in template values from the params array, simply set the third parameter to the error message template string to use The special variable %__msg% is reserved: use it only to specify where a message passed in by the user should be placed in the template, like so: Error message: %msg% - internal error If the message passed like so: $stack->push(ERROR_CODE , 'error', array (), 'server error 500');
The returned error message will be "Error message: server error 500 - internal error"
Parameters:
getErrorMessageTemplate [line 937]
string getErrorMessageTemplate(
$code)
|
|
Standard Error Message Template generator from code
Parameters:
getErrors [line 710]
array getErrors(
[boolean
$purge = false], [string
$level = false])
|
|
Retrieve all errors since last purge
Parameters:
getFileLine [line 828]
array|false getFileLine(
unused
$code, integer
$params, [array
$backtrace = null])
|
|
Standard file/line number/function/class context callback This function uses a backtrace generated from http://www.php.net/debug_backtrace and so will not work at all in PHP < 4.3.0. The frame should reference the frame that contains the source of the error.
Parameters:
getMessageCallback [line 347]
array|string|false getMessageCallback(
)
|
|
Get an error code => error message mapping callback This method returns the current callback that can be used to generate error messages
hasErrors [line 695]
boolean hasErrors(
[string|array
$level = false])
|
|
Determine whether there are any errors on the stack
Parameters:
pop [line 660]
Pop an error off of the error stack
popCallback [line 416]
array|string|false popCallback(
)
|
|
Remove a callback from the error callback stack
push [line 493]
PEAR_Error|array push(
int
$code, [string
$level = 'error'], [array
$params = array()], [string
$msg = false], [array
$repackage = false], [array
$backtrace = false])
|
|
Add an error to the stack If the message generator exists, it is called with 2 parameters. - the current Error Stack object
- an array that is in the same format as an error. Available indices
are 'code', 'package', 'time', 'params', 'level', and 'context'
Next, if the error should contain context information, this is handled by the context grabbing method. Finally, the error is pushed onto the proper error stack
Parameters:
pushCallback [line 406]
void pushCallback(
string|array
$cb)
|
|
Set an error Callback If set to a valid callback, this will be called every time an error is pushed onto the stack. The return value will be used to determine whether to allow an error to be pushed or logged. The return value must be one of the ERRORSTACK_* constants. This functionality can be used to emulate PEAR's pushErrorHandling, and the PEAR_ERROR_CALLBACK mode, without affecting the integrity of the error stack or logging
Parameters:
raiseError [line 970]
emulate PEAR::raiseError()
setContextCallback [line 377]
void setContextCallback(
array|string|null
$contextCallback)
|
|
Set a callback that generates context information (location of error) for an error stack This method sets the callback that can be used to generate context information for an error. Passing in NULL will disable context generation and remove the expensive call to debug_backtrace()
Parameters:
setDefaultCallback [line 360]
void setDefaultCallback(
[array|string
$callback = false], [string
$package = false])
|
|
Sets a default callback to be used by all error stacks This method sets the callback that can be used to generate error messages for a singleton
Parameters:
setDefaultLogger [line 300]
void setDefaultLogger(
&$log, Log
$log)
|
|
Set up a PEAR::Log object for all error stacks that don't have one
Parameters:
setErrorMessageTemplate [line 959]
string setErrorMessageTemplate(
$template)
|
|
Set the Error Message Template array The array format must be: array(error code => 'message template',...) Error message parameters passed into push() will be used as input for the error message. If the template is 'message %foo% was %bar%', and the parameters are array('foo' => 'one', 'bar' => 'six'), the error message returned will be 'message one was six'
Parameters:
setLogger [line 313]
void setLogger(
&$log, Log
$log)
|
|
Set up a PEAR::Log object for this error stack
Parameters:
setMessageCallback [line 329]
void setMessageCallback(
array|string
$msgCallback)
|
|
Set an error code => error message mapping callback This method sets the callback that can be used to generate error messages for any instance
Parameters:
singleton [line 254]
PEAR_ErrorStack &singleton(
string
$package, [callback
$msgCallback = false], [callback
$contextCallback = false], [boolean
$throwPEAR_Error = false], [string
$stackClass = 'PEAR_ErrorStack'])
|
|
Return a single error stack for this package. Note that all parameters are ignored if the stack for package $package has already been instantiated
Parameters:
staticGetErrors [line 776]
array staticGetErrors(
[boolean
$purge = false], [string
$level = false], [boolean
$merge = false], [array
$sortfunc = array('PEAR_ErrorStack', '_sortErrors')])
|
|
Get a list of all errors since last purge, organized by package
Parameters:
staticHasErrors [line 749]
boolean staticHasErrors(
[string|false
$package = false], [string
$level = false])
|
|
Determine whether there are any errors on a single error stack, or on any error stack The optional parameter can be used to test the existence of any errors without the need of singleton instantiation
Parameters:
staticPop [line 679]
boolean staticPop(
string
$package)
|
|
Pop an error off of the error stack, static method
Parameters:
staticPopCallback [line 443]
array|string|false staticPopCallback(
)
|
|
Remove a temporary overriding error callback
staticPush [line 603]
PEAR_Error|array staticPush(
string
$package, int
$code, [string
$level = 'error'], [array
$params = array()], [string
$msg = false], [array
$repackage = false], [array
$backtrace = false])
|
|
Static version of push()
Parameters:
staticPushCallback [line 433]
void staticPushCallback(
string|array
$cb)
|
|
Set a temporary overriding error callback for every package error stack Use this to temporarily disable all existing callbacks (can be used to emulate the @ operator, for instance)
Parameters:
_log [line 624]
void _log(
array
$err, array
$levels)
|
|
Log an error using PEAR::Log
Parameters:
_sortErrors [line 804]
void _sortErrors(
$a,
$b)
|
|
Error sorting function, sorts by time
Parameters:
Documentation generated on Sun, 19 Apr 2020 14:22:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|