Re: PEAR::DB, backends and assertExtension
| From: | Stig S. Bakken | Date: | Sat, 13 Oct 2001 23:22:44 +0000 |
| Subject: | Re: PEAR::DB, backends and assertExtension | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2277@lists.php.net to get a copy of this message | ||
Markus Fischer wrote:
>
> In IRC someone pointed out that the error handling for database
> backends, which aren't available on the system, are not very
> sufficient.
>
> A few backends use assertExtension to detect whethere the module
> is available or not. But it doesn't return an Error object but
> only returns false which is not handled in the context (mysql)
>
> Some don't use assertExtension and fail when calling a
> non-existing connect function (msql)
>
> Some prepend the connect function call with '@' and the
> application then exits silently (mssql).
>
> Is someone working on this?
>
> If not, I can do it. My proposal would be to always return an
> pear error object then indicating that the backend is not
> availabble (but it should *not* 'DB_ERROR_NOT_FOUND' because this
> is already used the backend.php file is not available). I would
> suggest return a new error DB_ERROR_BACKEBD_NOT_FOUND.
>
> I hope I just haven't overseen an important thing :-)
No you haven't overseen anything, so feel free to make it
suff^H^H^H^Hconsistent :-)
- Stig