Re: [Phplib-users] RE: sys_procedures
Brought to you by:
nhruby,
richardarcher
From: nathan r. h. <na...@ds...> - 2001-11-15 22:21:48
|
On Thu, 15 Nov 2001, Frank Bax wrote: > At 04:56 PM 11/15/01 -0500, nathan r. hruby wrote: > >On Thu, 15 Nov 2001, Frank Bax wrote: > >> I just had a look at this. It didn't take me long to find that phplib has > >> a fundamental problem. I only supports a single database per installation! > >> Excuse me if this has been observed before, but I just realised it; I > >> never went much beyond local.inc before today. > > > >Woah! It does, you just need multiple local.inc's and / or prepend.php3's > >So, it does, just not within the same instance. > > When I wrote it, I was thinking about accessing two different databases in > the same script. > > How does one support multiple local.inc and prepend.php files? > > Frank > This might do it, it might not. class foo { var db; function foo() { global $_PHPLIB include($PHPLIB[libdir]. "/DB_of_choice"); $var = new DB_SQL } } $foo->db->query("SELECT bar FROM baz WHERE baz.gnu='gnomovision'"); In theory the Object namespace in php is protected from from the global namespace so an include() statement in a instanced class should only affect the namespace inside that particular object, not gloablly, so *in theory* there shouldn't be any namespace collsions. <hedge> I may be grossly misinformed about the way namespaces work, if so, then please disreagrad and just know that mixing db's in a script is not a too teribliy good idea in terms of maintainibility </hedge> -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |