cvs: peardoc /en/core/pear/pear-errorstack intro.xml
| From: | Greg Beaver | Date: | Thu, 12 Oct 2006 20:10:42 +0000 |
| Subject: | cvs: peardoc /en/core/pear/pear-errorstack intro.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-8595@lists.php.net to get a copy of this message | ||
cellog Thu Oct 12 20:10:42 2006 UTC
Modified files:
/peardoc/en/core/pear/pear-errorstack intro.xml
Log:
fix Doc Bug #4940 Wrong syntax for the The Backwards compatibility set up in the documentation
http://cvs.php.net/viewvc.cgi/peardoc/en/core/pear/pear-errorstack/intro.xml?r1=1.14&r2=1.15&diff_format=u
Index: peardoc/en/core/pear/pear-errorstack/intro.xml
diff -u peardoc/en/core/pear/pear-errorstack/intro.xml:1.14
peardoc/en/core/pear/pear-errorstack/intro.xml:1.15
--- peardoc/en/core/pear/pear-errorstack/intro.xml:1.14 Wed Nov 30 03:22:44 2005
+++ peardoc/en/core/pear/pear-errorstack/intro.xml Thu Oct 12 20:10:42 2006
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.14 $ -->
+<!-- $Revision: 1.15 $ -->
<refentry id="core.pear.pear-errorstack.intro">
<refnamediv>
<refname>
@@ -678,7 +678,7 @@
<refsect1 id = "core.pear.pear-errorstack.intro.merging">
<title>
Backwards compatibility with PEAR_Error,
- Forward compatibility with PHP 5 Exception
+ Forward compatibility with PHP 5 Exception and PEAR_Exception
</title>
<para>
<classname>PEAR_ErrorStack</classname>
@@ -694,17 +694,9 @@
?>]]>
</programlisting>
</para>
- <warning>
- <title>Backward Compatibility break</title>
- <para>
- As of PEAR 1.3.2, PEAR_ErrorStack->push()
- no longer returns an exception class.
-
- Code that relies on this behavior will not work
- </para>
- </warning>
<para>
- PEAR_ErrorStack will return an exception automatically in PHP 5.
+ PEAR_ErrorStack can coordinate with the new PEAR_Exception class to
+ convert into an exception with this code:
You can set the exception class name that will be returned
using the following code:
@@ -713,7 +705,10 @@
<programlisting role = "php"><![CDATA[
<?php
require_once 'PEAR/ErrorStack.php';
-$stack = &PEAR_ErrorStack::singleton('mypackage', false, null,
'PEAR_ErrorStack', false, 'MyException');
+require_once 'PEAR/Exception.php';
+$stack = &PEAR_ErrorStack::singleton('mypackage');
+$stack->push(1, 'test error');
+throw new PEAR_Exception('did not work', $stack->pop());
?>]]>
</programlisting>
</para>