Re: Re: cvs: pear /DBA DBA.php DBA_Builtin.php DBA_Compat.phpDBA_Relational.php DBA_Simple.php DBA_Table.php package.xml /DBA/tests
benchmark.phpgraph_template simple.php
| From: | Tomas V.V.Cox | Date: | Sat, 22 Jun 2002 12:32:21 +0000 |
| Subject: | Re: Re: cvs: pear /DBA DBA.php DBA_Builtin.php DBA_Compat.phpDBA_Relational.php DBA_Simple.php DBA_Table.php package.xml /DBA/tests benchmark.phpgraph_template simple.php |
||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7286@lists.php.net to get a copy of this message | ||
Alexander Merz wrote:
>
> Brent Cook wrote:
>
> > The DBA drivers, the ones using trigger_error and returning booleans, are
> > most useful when they are embedded into a higher-level class. I'll be sure
> > to use raiseError on the higher levels; Table and Relational.
> Your driver classes can be used by other package developers and users
> too. Using trigger_error is not compliant to the PEAR standards and not
> the expected behavior of PEAR classes.
Alex, perhaps you missread my post about using trigger_error. The
Validate methods are static and only return bool True or False. There
are specific cases where the developer could use the class in a wrong
way, so instead of just fail or change the whole API to use PEAR Error
(loosing by the way some usability) we trigger the warning "hey
developer fix the code".
In the other cases it's much better to use PEAR Errors, for example when
you need to return text messages/error codes, set a class error handler,
etc.
Tomas V.V.Cox