Re: DB Exceptions - Sample Code

From: Date: Thu, 08 Jul 2004 20:06:02 +0000
Subject: Re: DB Exceptions - Sample Code
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31763@lists.php.net to get a copy of this message
Hundiak, Arthur wrote:
I took the latest PEAR DB code and tweaked it to run under PHP5 E_STRICT. I also tweaked PEAR.php as well. I then added the ability to set an "error mode" which causes DB to throw exceptions instead of returning errors. The application can chose between using error objects or exceptions. I then added a couple of very simple test files which show some of the differences between the modes. The code is available from: http://www.cerad.org/pear/pear5a.tgz I think having some running code to look at might help in this debate. IMHO, allowing the application to chose how unusual conditions are dealt with might be the way to go.
could you put up .phps files? I have also been pondering how to make MDB2 able to throw exceptions or error objects based on a user config. my first idea was that all calls from public internals methods to other public internal methods need to push to "dont return exception" stack. this way MDB2 could remain php4 compatible while still supporting exceptions. internally MDB2 would not use exceptions. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

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