Re: Applications using PEAR
| From: | Greg Beaver | Date: | Sat, 04 Oct 2003 03:23:43 +0000 |
| Subject: | Re: Applications using PEAR | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8275@lists.php.net to get a copy of this message | ||
Hi Jacob,
You may not need to extend PEAR_Error - check out the work I've done with error handling/raising at
http://www.chiaraquartet.net/apidoc
As for error codes - PEAR doesn't use them currently, it's something that is a big gaping hole in the project that is slowly but surely being addressed.
There's also a big example of how to use error handling in the documentation for raiseError at
http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php
Incidentally, since I wrote the example, if you have any questions, feel free to ask, I'd love to get it even clearer.
Regards,
Greg
Jacob@Keystreams.Com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am building an application that has a base class extending PEAR called RHH (controls db, logging and other base requirements of the system) onto which each class of the application extends itself from. In addition to many things already implemented, I want RRH to control the error handling for every other class of the application. I have looked at various other PEAR packages and have gleaned about a 60% understanding of how to do this but I can't seem to find any real good information on doing this sort of thing for an application that could potentially have hundreds of classes extending from RRH. The following is a few things I would like to learn more about: - - PEAR native error codes: What are they and how do I map them? How do I map error codes from the classes extending RRH back to it? - - Error handling: What is the hierarchy for this? i.e.: If setErrorHandling is set for PEAR and then for individual classes which actually controls the final result? Does php.ini's error settings affect any of these? - - Is the best (only) option to wrap isError, getMessage and raiseError and if so is there a 'best' way to do this? I know this may be a tall order and I respect that there may be some RTFM's but I think all I need is a push in the right direction. Some sample code would be great! Thanks, Jacob -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQE/fi8aLeoSBberRbgRAs15AJiV0vnreiOW9uY/9PN612KmwkvtAKCiqZJW PKwslrtiSTcNg3t/Ud7gXg== =b90t -----END PGP SIGNATURE-----