diff options
-rw-r--r-- | pear/PEAR.php | 30 | ||||
-rw-r--r-- | pear/package-PEAR.xml | 44 |
2 files changed, 48 insertions, 26 deletions
diff --git a/pear/PEAR.php b/pear/PEAR.php index 7f034b7b0a..0543be1ea3 100644 --- a/pear/PEAR.php +++ b/pear/PEAR.php @@ -1,7 +1,7 @@ <?php // // +----------------------------------------------------------------------+ -// | PHP Version 4 | +// | PEAR, the PHP Extension and Application Repository | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ @@ -21,11 +21,12 @@ // $Id$ // -define('PEAR_ERROR_RETURN', 1); -define('PEAR_ERROR_PRINT', 2); -define('PEAR_ERROR_TRIGGER', 4); -define('PEAR_ERROR_DIE', 8); -define('PEAR_ERROR_CALLBACK', 16); +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +define('PEAR_ERROR_EXCEPTION', 32); define('PEAR_ZE2', (function_exists('version_compare') && version_compare(zend_version(), "2-dev", "ge"))); @@ -243,8 +244,8 @@ class PEAR * * @param int $mode * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE or - * PEAR_ERROR_CALLBACK. + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. * * @param mixed $options * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one @@ -268,6 +269,7 @@ class PEAR * @see PEAR_ERROR_TRIGGER * @see PEAR_ERROR_DIE * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION * * @since PHP 4.0.5 */ @@ -287,6 +289,7 @@ class PEAR case PEAR_ERROR_PRINT: case PEAR_ERROR_TRIGGER: case PEAR_ERROR_DIE: + case PEAR_ERROR_EXCEPTION: case null: $setmode = $mode; $setoptions = $options; @@ -436,8 +439,8 @@ class PEAR * to define these if you want to use codes) * * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE or - * PEAR_ERROR_CALLBACK. + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. * * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter * specifies the PHP-internal error level (one of @@ -683,8 +686,8 @@ class PEAR_Error * @param int $code (optional) error code * * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, - * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER or - * PEAR_ERROR_CALLBACK + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION * * @param mixed $options (optional) error level, _OR_ in the case of * PEAR_ERROR_CALLBACK, the callback function or object/method @@ -752,6 +755,9 @@ class PEAR_Error @call_user_func($this->callback, $this); } } + if (PEAR_ZE2 && $this->mode & PEAR_ERROR_EXCEPTION) { + eval('throw $this;'); + } } // }}} diff --git a/pear/package-PEAR.xml b/pear/package-PEAR.xml index a3cdf6bb1a..4965f30255 100644 --- a/pear/package-PEAR.xml +++ b/pear/package-PEAR.xml @@ -31,23 +31,14 @@ </maintainer> </maintainers> <release> - <version>1.0.1</version> + <version>1.1-dev</version> <state>stable</state> <date>2003-01-10</date> <notes> -* PEAR_Error class has call backtrace available by - calling getBacktrace(). Available if used with - PHP 4.3 or newer. - -* PEAR_Config class uses getenv() rather than $_ENV - to read environment variables. - -* System::which() Windows fix, now looks for - exe/bat/cmd/com suffixes rather than just exe - -* Added "pear cvsdiff" command - -* Windows output buffering bugfix for "pear" command +* PEAR_Error now supports exceptions when using Zend Engine 2. Set the + error mode to PEAR_ERROR_EXCEPTION to make PEAR_Error throw itself + as an exception (invoke PEAR errors with raiseError() or throwError() + just like before). </notes> <filelist> <file role="data" name="package.dtd"/> @@ -102,6 +93,31 @@ </release> <changelog> <release> + <version>1.0.1</version> + <state>stable</state> + <date>2003-01-10</date> + <notes> + * PEAR_Error class has call backtrace available by + calling getBacktrace(). Available if used with + PHP 4.3 or newer. + + * PEAR_Config class uses getenv() rather than $_ENV + to read environment variables. + + * System::which() Windows fix, now looks for + exe/bat/cmd/com suffixes rather than just exe + + * Added "pear cvsdiff" command + + * Windows output buffering bugfix for "pear" command + </notes> + <deps> + <dep type="php" rel="ge" version="4.1"/> + <dep type="pkg" rel="ge" version="0.4">Archive_Tar</dep> + <dep type="pkg" rel="ge" version="0.11">Console_Getopt</dep> + </deps> + </release> + <release> <version>1.0</version> <state>stable</state> <date>2002-12-27</date> |