[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twig-devel
Subject:    RE: [Twig-devel] Extending dbQuery()
From:       "Aaron Stone" <aaron () serendipity ! palo-alto ! ca ! us>
Date:       2005-03-16 20:35:14
Message-ID: twig.1111005314.87789 () serendipity ! palo-alto ! ca ! us
[Download RAW message or body]

Ah, wait, problem:

Here's what I wanted to see:

$dbconfig["spamassassin_table"] = array( "server" => "otherhost", "table"
=> "spamassassin_config_table" );

Except that the tables are embedded into the query, and so would only
appear as 'Array' when cast to a string, and would lose any information to
recover which key in the $dbconfig array was being called upon.

I'll go back to the drawing board...

Aaron


On Wed, Mar 16, 2005, ""Greg Ross"" <greg@darkphoton.com> said:

> 	I think one of us missed something, I believe Aaron was suggesting
> that the dbQuery() function definition does not change but that instead code
> is added to it to look at what feature is currently being loaded and then
> doing something like $dbconfig[$feature]["sqlserver"], etc to connect to the
> db.
> 
> 	In that case there's no way to tell dbquery() which one to use once
> inside a feature.
> 
> 						Greg
> 
>> -----Original Message-----
>> From: twig-devel-admin@informationgateway.org [mailto:twig-devel-
>> admin@informationgateway.org] On Behalf Of m. allan noah
>> Sent: Wednesday, March 16, 2005 2:11 PM
>> To: twig-devel@informationgateway.org
>> Subject: RE: [Twig-devel] Extending dbQuery()
>> 
>> yes you could- define a new table entry in dbconfig for the new table in
>> the other db.
>> 
>> allan
>> 
>> On Wed, 16 Mar 2005, Greg Ross wrote:
>> 
>> >
>> > 	I did think of this first, however if a single feature wanted to
>> > talk to two different db's then it couldn't.
>> >
>> > 						Greg
>> >
>> >
>> >> -----Original Message-----
>> >> From: twig-devel-admin@informationgateway.org [mailto:twig-devel-
>> >> admin@informationgateway.org] On Behalf Of Aaron Stone
>> >> Sent: Wednesday, March 16, 2005 1:53 PM
>> >> To: twig-devel@informationgateway.org
>> >> Subject: Re: [Twig-devel] Extending dbQuery()
>> >>
>> >> I think it would make more sense to have this specified from
>> >> config/dbconfig.inc.php3, where all of the tables are identified.
>> >>
>> >> If one of the table entries is actually an array, then we assume it
>> >> carries full connection information as you specify below. The smarts
>> >> become embedded into dbQuery and entirely transparent to the feature
>> code.
>> >>
>> >> Aaron
>> >>
>> >>
>> >> On Wed, Mar 16, 2005, ""Greg Ross"" <greg@darkphoton.com> said:
>> >>
>> >>> 	I'd like to change dbQuery() to allow for different db/servers to be
>> >>> accessed by adding a new parameter that allows you to define which
>> >>> server/database to use.
>> >>>
>> >>> 	Basically changing the function definition from:
>> >>>
>> >>> 	Function dbQuery( $statement )
>> >>>
>> >>> 	To
>> >>>
>> >>> 	Function dbQuery( $statement, $dbconf = array() )
>> >>>
>> >>> 	Where $dbconf would be an array that would contain:
>> >>>
>> >>> 	$dbconf["sqlserver"]
>> >>>  	$dbconf["sqlport"]
>> >>>  	$dbconf["sqlusername"]
>> >>>  	$dbconf["sqlpassword"]
>> >>>  	$dbconf["defaultdb"]
>> >>>
>> >>> 	These values would override the standard $dbconfig[] values for that
>> >>> call to dbQuery() if they were set.
>> >>>
>> >>> 	If $dbconf[] was not passed or was empty then the $dbconfig[] values
>> >>> would be used just as they are now.
>> >>>
>> >>> 	This would allow the SpamPref's addon to access the prefs table in
>> >>> another db instead of TWIG's.  Also, at some point if we wanted to we
>> >> could
>> >>> define a different $dbconf[] value for each feature allow for each
>> >> feature
>> >>> in twig to be stored on a different db or server.
>> >>>
>> >>> 					Greg
>> >>>
>> >>> _______________________________________________
>> >>> Twig-devel mailing list
>> >>> Twig-devel@informationgateway.org
>> >>> http://informationgateway.org/mailman/listinfo/twig-devel
>> >>>
>> >>
>> >> --
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> Twig-devel mailing list
>> >> Twig-devel@informationgateway.org
>> >> http://informationgateway.org/mailman/listinfo/twig-devel
>> >
>> > _______________________________________________
>> > Twig-devel mailing list
>> > Twig-devel@informationgateway.org
>> > http://informationgateway.org/mailman/listinfo/twig-devel
>> >
>> 
>> --
>> "so don't tell us it can't be done, putting down what you don't know.
>> money isn't our god, integrity will free our souls" - Max Cavalera
>> _______________________________________________
>> Twig-devel mailing list
>> Twig-devel@informationgateway.org
>> http://informationgateway.org/mailman/listinfo/twig-devel
> 
> _______________________________________________
> Twig-devel mailing list
> Twig-devel@informationgateway.org
> http://informationgateway.org/mailman/listinfo/twig-devel
> 

-- 



_______________________________________________
Twig-devel mailing list
Twig-devel@informationgateway.org
http://informationgateway.org/mailman/listinfo/twig-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic