PEAR_ErrorStack renaming question

From: Date: Thu, 02 Sep 2004 03:30:40 +0000
Subject: PEAR_ErrorStack renaming question
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33175@lists.php.net to get a copy of this message
Hi all, Because PEAR_ErrorStack is most useful for php4 error handling, and bridging the gap between error handling in php4 to php5 exceptions, I don't think changing the name will be a good idea. If we have a document that says you gotta use exceptions (and we do), there may be some confusion, but I would be surprised. Besides, who are we to tell developers outside of PEAR how they should code? We should control the code *inside* PEAR and let others do whatever they please. PEAR_ErrorStack is a stack-based implementation for storing error conditions. Having said all of this, I think the current stack implementation needs some work, but not for the reasons given on the list. I will not engage in any polemical battles over the technical details, but will accept any good ideas :). My current thought is that it would be interesting to define a child class of PEAR_Exception named PEAR_Warning whose sole purpose would be to allow a transaction-style error aggregation. By this I mean that PEAR_Warning would have a method that says "start noticing non-fatal errors" and from this point on, any warning that is registered through its monitoring of PEAR_ErrorStack *and* the use of PEAR_Warning::add() (name is negotiable) would be simply placed into a holding array. When the method that says "stop noticing non-fatal errors" is called, a PEAR_Exception can easily be created with the PEAR_Warning as a cause, and all of the warnings would be clearly and easily delineated by where they came from. This would ultimately make PEAR_ErrorStack only useful in the transition from php4 to php5, and that was its original intent anyways :). In any case, I would appreciate it if people hold off on the standard positive and negative critiques until they see the code I'm talking about, it should be very short code. Greg

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