Re: Re: [PROPOSAL] DB_Simple
| From: | Greg Beaver | Date: | Mon, 03 Nov 2003 05:38:02 +0000 |
| Subject: | Re: Re: [PROPOSAL] DB_Simple | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-23201@lists.php.net to get a copy of this message | ||
Paul M Jones wrote:
Hi Paul, Actually, extending PEAR will limit you to local PEAR settings for error handling. Try simply adding throwError() to your class, and calling PEAR::raiseError() from throwError() function throwError($message, $code, $userinfo) {Also, I see no reason for you to be extending PEAR, you only see to use PEAR::isError and as you call that statically, no extension of the PEAR class is needed.I use $this->throwError() a lot. I think extending PEAR allows the class to honor the "global" PEAR settings for handling errors. -- pmj
require_once 'PEAR.php';
return PEAR::raiseError($message, $code, null, null, $userinfo); // might need a few more nulls, this is from memory :)
}
Regards,
Greg