Re: DB_DataObject and instance reuse

From: Date: Fri, 10 Jun 2005 09:20:30 +0000
Subject: Re: DB_DataObject and instance reuse
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38069@lists.php.net to get a copy of this message
Alan Knowles wrote:
On Thu, 2005-06-09 at 23:41 +0200, Lukas Smith wrote:
Alan Knowles wrote:
I'm not sure it's a big issue, I dont think many of the backends actually create new connections. and you can usually use $DB =
you are talking about the extensions reusing connections to the same host? i am talking about reusing the entire instance.
$DB_DataObject->getDatabaseConnection(); to get the connection object anyway.
ok, that would work if the direct usuage is a secondary option and not the primary (and db_do the secondary).
It would not be do difficult to add, something like this: function setDatabaseConnection(&$con) { // check if $con is really a connection?! $GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][md5($con->dsn)] = &$con; }
that would work .. well in MDB2 you would have to use the getDSN() method since the dsn property does not include the database name. regards, Lukas

« previous php.pear.dev (#38069) next »