Re: [PHP-PEAR] RFC on merge of PHPLib and Pear
[email protected] ((Stig Sæther Bakken)) 09 Mar 2001 00:15:14 +0100
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
["Paul Meagher" <[email protected]>] > > Giving runtime parameters to DB_Sql is also possible. > > I have done this in a recent quick hack. Didn't bother subclassing. Just > "hard coded" the db parameters in the class. So setting configs manually > is possible but not really recommended with PHPLIB. > > This brings up another issue for me. Say I want to distribute a little app > on Freshmeat and I want to use a db abstraction layer in my app. With > PHPLIB this is quite easy. I can just grab the db_sql class for mysql and > bundle that with the app. > > Was PEAR::DB developed to allow similiar distribution of, say, the mysql > class? If I want to include PEAR's db abstraction layer for MySQL in my > little app, what is the minumum I would need? Like Jon said, DB will be distributed with PHP, so you don't really need to distribute it yourself. If you do need to distribute it, for example with mysql support only, you need three files: DB.php, DB/common.php and DB/mysql.php. PEAR DB is designed to let implementations for different databases be installed separately (this is one of the reasons for the connect performance hit). In order to add support for the "foo" database, you need the file DB/foo.php. That's it. - Stig -- Stig Sæther Bakken <[email protected]> Fast Search & Transfer ASA, Trondheim, Norway