Re: DB_DataObject and instance reuse
| From: | Alan Knowles | Date: | Fri, 10 Jun 2005 00:56:23 +0000 |
| Subject: | Re: DB_DataObject and instance reuse | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-38059@lists.php.net to get a copy of this message | ||
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;
}
Regards
Alan
>
> regards,
> Lukas
>