Re: PEAR and DB abstraction layer (was: PHPLIB)
| From: | Graeme Merrall | Date: | Mon, 26 Jun 2000 23:54:17 +0000 |
| Subject: | Re: PEAR and DB abstraction layer (was: PHPLIB) | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-646@lists.php.net to get a copy of this message | ||
Jennifer wrote:
>
> >You're a brave man. Some days ago I had to drop using PEAR's DB
> >abstraction layer for a project because it didn't seem to work at the
> >time, and I couldn't find authoritative docs.
>
> Could someone direct me where to find out more about PEAR?
>
> Also, could someone explain to me what an abstraction layer is?
PEAR is a code library which will aim to provide a common code interface
to various PHP classes and so on. A similar thing is perl's CPAN library
which is a huge repository of classes which all have a basic common
characteristics so they can be easily downloaded, installed and used.
The abstraction library is a layer on top of PHP native DB functions
that serves to isolate you from the actual database functions. Thus you
use one set of common functions to access the data from the database,
and even if the underlaying code changes or even the database changes,
your code is not affected.
For example, mysql_query and odbc_do are to different functions but you
could have an abstraction library that merely says db_runquery() and the
abstraction library would handle the rest.
Cheers,
Graeme