do pear packages create their own seperate DB connections?
| From: | Jeroen Houben | Date: | Tue, 22 Apr 2003 13:09:05 +0000 |
| Subject: | do pear packages create their own seperate DB connections? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-15323@lists.php.net to get a copy of this message | ||
Hi,
A lot of packages use DB (and in the future hopefully MDB) and they all
need a DSN as a constructor parameter. IMO it would be nice if packages
like Auth and Tree etc etc would also accept a reference to an existing
connection.
Just to give you an example of how things can look right now (syntax may
not be completely correct)
$conn = MDB::connect($dsn);
$auth = new Auth('imap',array("dsn"=>$dsn));
$tree = Tree::create('db', array("dsn"=>$dsn));
$pm = new Auth_prefemanager(array("dsn"=>$dsn));
These would all create seperate links and thus overhead, right? Or does
(M)DB already check for an existing connection and use that if it can?
Jeroen