Re: [Seagull-general] Re: [PEAR] error handling and conditional inclusion of PEAR.php
| From: | Demian Turner | Date: | Sun, 30 May 2004 13:21:46 +0000 |
| Subject: | Re: [Seagull-general] Re: [PEAR] error handling and conditional inclusion of PEAR.php | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12803@lists.php.net to get a copy of this message | ||
Hi Stefan
Hi, you have to at least include PEAR.php, but not extend from it. PEAR::isError() is a static call - so there is no need that the class extends from PEAR. However, you are true that for every script usingalready doing that ;-)
isEror() PEAR.php would have to be loaded - which might be unnecessary overhead in certain scripts. Therefor afaik some people are using is_a($result, 'PEAR_Error') ... maybe that would be a cleaner solution to the problem, since you won't have to include PEAR.php just for the check?excellent - this is a great solution, thanks - you just saved me 1000 LOC per page exec. I haven't had time to follow the lists too closely recently but I imagine there is something in the works so DB doesn't unconditionally include PEAR as well? MDB2? cheers Demian