Re: do pear packages create their own seperate DB connections?
| From: | Wolfram Kriesing | Date: | Wed, 23 Apr 2003 10:02:40 +0000 |
| Subject: | Re: do pear packages create their own seperate DB connections? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15376@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
1) make singleton the default (requiring no changes to any packages) 2) make singleton optional: MDB::singleton($dsn, $options) 3) make singleton optional through a constant 4) make singleton optional through a variable 1) would mean that every package would have to keep some kind of flag based on which to decide if to request a singleton 2) is probably the cleanest. But it is somewhat inconvenient. 3) would be a bit inflexible 4) would mean another global variablei would prefer 2) just a note: for [M]DB i think it makes most sense to modify the meaning of singleton a bit. In order to return always the same instance for the same DSN, or not? i just mean for the following case: $db1 = MDB::singleton('mysql://localhost/db1',$options) $db2 = MDB::singleton('mysql://localhost/db2',$options) where $db1 and $db2 should be 2 different instances of [M]DB, since the DSN is different. -- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth