You are here

function PEAR::pushErrorHandling in Calendar Systems 5

Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.

Parameters

mixed $mode (same as setErrorHandling):

mixed $options (same as setErrorHandling):

Return value

bool Always true

See also

PEAR::setErrorHandling

File

calendar/lib/PEAR.php, line 685

Class

PEAR
Base class for other PEAR classes. Provides rudimentary emulation of destructors.

Code

function pushErrorHandling($mode, $options = null) {
  $stack =& $GLOBALS['_PEAR_error_handler_stack'];
  if (isset($this) && is_a($this, 'PEAR')) {
    $def_mode =& $this->_default_error_mode;
    $def_options =& $this->_default_error_options;
  }
  else {
    $def_mode =& $GLOBALS['_PEAR_default_error_mode'];
    $def_options =& $GLOBALS['_PEAR_default_error_options'];
  }
  $stack[] = array(
    $def_mode,
    $def_options,
  );
  if (isset($this) && is_a($this, 'PEAR')) {
    $this
      ->setErrorHandling($mode, $options);
  }
  else {
    PEAR::setErrorHandling($mode, $options);
  }
  $stack[] = array(
    $mode,
    $options,
  );
  return true;
}