Re: Re: PEAR_Exception in CVS

From: Date: Fri, 02 Jul 2004 21:42:09 +0000
Subject: Re: Re: PEAR_Exception in CVS
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31508@lists.php.net to get a copy of this message
Greg Beaver wrote:
So how about merging PEAR_Excption and PEAR_ErrorStack to make ONE package/class/file/whatever that we can include with our scripts that will do all the problem handling?
This is the idea I hope can be figured out. I want a script that can be used to pull legacy packages in with php5-only, wherever possible. Of course, if it ain't, then screw it, we'll just have to let php4 solutions be, and go with a great php5-only one.
I like that idea. Throw PEAR_Exception by deafult, but use ErrorStack to manage stacks for warnings and notices. I do still think an interface is an essential part of that system, though: $obj->doABunchOfStuff(); if ($obj instanceof IWarn) { $warnings = $obj->getWarnings(); // handle them, or whatever. } In many cases calling code won't care what classes have warnings. ErrorStack will have handled logging & no one cares beyond that. In some cases classes will want to "handle" the warnings, though, and there should be an interface to indicate that a class has a getWarnings() (and other) method. This is PHP5 only. I think that's the way to go because nothing PHP4 is gonna run in E_STRICT, hence no PHP5 PEAR package can work with any PHP4-friendly libraries. Hans

« previous php.pear.dev (#31508) next »