<?php
//
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PEAR, the PHP Extension and Application Repository |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// $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")));
*
* @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
* @see PEAR_ERROR_TRIGGER
* @see PEAR_ERROR_DIE
* @see PEAR_ERROR_CALLBACK
+ * @see PEAR_ERROR_EXCEPTION
*
* @since PHP 4.0.5
*/
case PEAR_ERROR_PRINT:
case PEAR_ERROR_TRIGGER:
case PEAR_ERROR_DIE:
+ case PEAR_ERROR_EXCEPTION:
case null:
$setmode = $mode;
$setoptions = $options;
* 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
* @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
@call_user_func($this->callback, $this);
}
}
+ if (PEAR_ZE2 && $this->mode & PEAR_ERROR_EXCEPTION) {
+ eval('throw $this;');
+ }
}
// }}}
</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"/>
</deps>
</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>