DB Exceptions - Sample Code
| From: | Hundiak, Arthur | Date: | Thu, 08 Jul 2004 20:00:06 +0000 |
| Subject: | DB Exceptions - Sample Code | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-31762@lists.php.net to get a copy of this message | ||
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.