Re: PEAR framework changes for PHP5
| From: | Greg Beaver | Date: | Thu, 29 Jan 2004 21:40:37 +0000 |
| Subject: | Re: PEAR framework changes for PHP5 | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.core |
| Request: | Send a blank email to pear-core+get-88@lists.php.net to get a copy of this message | ||
Hi Tobias,
It uses the actual PEAR_Error class, if you pass in a flag variable to the singleton or constructor. No compatibility hacks needed. As for raiseError/throwError, it won't use these methods, since they have no relevance to a stack. The internal structure has little in common with the old PEAR_Error, making it so would defeat the purpose of using it, actually :)
However, it doesn't stop you from using existing PEAR_Error callbacks with the compatibility until code is updated. However, the best way to use an older version is to instead create a PEAR_Error callback that pushes the old errors onto the new stack, and then only uses the stack.
The stack has built in logging capability as well (knows PEAR::Log)
Greg
Tobias Schlitt wrote:
Greg Beaver wrote:Hi,Hi Greg!I've got a nearly complete error stack class that can both return a PEAR_Error class and an Exception class, if desired, but uses arrays for the stack storage. It has all of the features of PEAR_Error plus extra functionality that I've been wanting like error levels and package-specific errors, so that error codes have some meaning without needing to know the number a code represents.That sounds phantastic to me. Could it be implemented as near as possible to the PEAR_Error class? I think of a switch between new and old behavior or something? Regards, Toby