File/maintenance/libraries/pear/PEAR/ErrorStack.php

Description

Error Stack Implementation

This is an incredibly simple implementation of a very complex error handling facility. It contains the ability to track multiple errors from multiple packages simultaneously. In addition, it can track errors of many levels, save data along with the error, context information such as the exact file, line number, class and function that generated the error, and if necessary, it can raise a traditional PEAR_Error. It has built-in support for PEAR::Log, to log errors as they occur

Since version 0.2alpha, it is also possible to selectively ignore errors, through the use of an error callback, see pushCallback()

Since version 0.3alpha, it is possible to specify the exception class returned from push()

Since version PEAR1.3.2, ErrorStack no longer instantiates an exception class. This can still be done quite handily in an error callback or by manipulating the returned array

Classes
Class Description
 class PEAR_ErrorStack Error Stack Implementation
Constants
PEAR_ERRORSTACK_ERR_NONCLASS = 1 (line 131)

Error code for an attempt to instantiate a non-class as a PEAR_ErrorStack in the singleton method.

PEAR_ERRORSTACK_ERR_OBJTOSTRING = 2 (line 137)

Error code for an attempt to pass an object into PEAR_ErrorStack::getMessage()

that has no __toString() method

PEAR_ERRORSTACK_IGNORE = 4 (line 124)

If this is returned, then the error is completely ignored.

One of four possible return values from the error Callback

  • see: PEAR_ErrorStack::_errorCallback()
PEAR_ERRORSTACK_LOG = 3 (line 120)

If this is returned, then the error will only be logged, but not pushed onto the error stack.

One of four possible return values from the error Callback

  • see: PEAR_ErrorStack::_errorCallback()
PEAR_ERRORSTACK_PUSH = 2 (line 115)

If this is returned, then the error will only be pushed onto the stack, and not logged.

One of four possible return values from the error Callback

  • see: PEAR_ErrorStack::_errorCallback()
PEAR_ERRORSTACK_PUSHANDLOG = 1 (line 110)

If this is returned, then the error will be both pushed onto the stack and logged.

One of four possible return values from the error Callback

  • see: PEAR_ErrorStack::_errorCallback()
Variables
array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] (line 76)

Global error callback (default)

This is only used if set to non-false. * is the default callback for all packages, whereas specific packages may set a default callback for all instances, regardless of whether they are a singleton or not.

To exclude non-singletons, only set the local callback for the singleton

array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] (line 89)

Global Log object (default)

This is only used if set to non-false. Use to set a default log object for all stacks, regardless of instantiation order or location

array $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] (line 62)

Singleton storage

Format:

 array(
  'package1' => PEAR_ErrorStack object,
  'package2' => PEAR_ErrorStack object,
  ...
 )

  • access: private

Documentation generated on Thu, 20 Jan 2005 17:09:45 +0000 by phpDocumentor 1.3.0RC3