PEAR::DB, backends and assertExtension
| From: | Markus Fischer | Date: | Sat, 13 Oct 2001 23:14:36 +0000 |
| Subject: | PEAR::DB, backends and assertExtension | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-2275@lists.php.net to get a copy of this message | ||
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 :-)
- Markus