diff options
| author | Stig Bakken <ssb@php.net> | 2002-07-21 07:04:45 +0000 |
|---|---|---|
| committer | Stig Bakken <ssb@php.net> | 2002-07-21 07:04:45 +0000 |
| commit | f246ef4239dcf5b8a1a9e2e8f7c4eca52ac194fa (patch) | |
| tree | ce60abfbce2e064f9e9e7b85b7803d45094a7aa4 /pear | |
| parent | c02cb64be777d4bf59ce7951bec7461954117432 (diff) | |
| download | php-git-f246ef4239dcf5b8a1a9e2e8f7c4eca52ac194fa.tar.gz | |
* always enable track_errors
* added throwError method (simpler version of raiseError)
Diffstat (limited to 'pear')
| -rw-r--r-- | pear/PEAR.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pear/PEAR.php b/pear/PEAR.php index 8b29290cb9..1541390db3 100644 --- a/pear/PEAR.php +++ b/pear/PEAR.php @@ -45,6 +45,8 @@ $GLOBALS['_PEAR_destructor_object_list'] = array(); $GLOBALS['_PEAR_shutdown_funcs'] = array(); $GLOBALS['_PEAR_error_handler_stack'] = array(); +ini_set('track_errors', true); + /** * Base class for other PEAR classes. Provides rudimentary * emulation of destructors. @@ -510,6 +512,27 @@ class PEAR } // }}} + // {{{ throwError() + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param string $message + * + */ + function &throwError($message = null, + $code = null, + $userinfo = null) + { + if (isset($this)) { + return $this->raiseError($message, $code, null, null, $userinfo); + } else { + return PEAR::raiseError($message, $code, null, null, $userinfo); + } + } + + // }}} // {{{ pushErrorHandling() /** |
