From: Andreas A. <a.a...@th...> - 2001-08-17 11:20:19
|
I just startet to optimize the code to fit with r2. Mostly convention changes and connectivity with $gDatasources. I guess on monday its cleaned up and usable like this: import('binarycloud.mgr.QueryManager'); $qm = new QueryManager('my_datasrc_hook'); $query = array('QUERY' => 'SELECT foo, bar FROM table....balh'); $values = $qm->DoCustomQuery($query, "", true); I have to do minor changes to metabase drivers (GetColumnNames(), oci already supports this). QM:_ProccessResult does need this. The alternative is to implement the database specific functions that are required directly into QM, but I don't like this. Alex, anything specific I have to take care of when r2ifying the code? Andi |
From: Alex B. <en...@tu...> - 2001-08-17 18:54:24
|
> I just startet to optimize the code to fit with r2. Mostly convention > changes and connectivity with $gDatasources. > > I guess on monday its cleaned up and usable like this: > > import('binarycloud.mgr.QueryManager'); > $qm = new QueryManager('my_datasrc_hook'); > > $query = array('QUERY' => 'SELECT foo, bar FROM table....balh'); > $values = $qm->DoCustomQuery($query, "", true); > > I have to do minor changes to metabase drivers (GetColumnNames(), oci > already supports this). QM:_ProccessResult does need this. The alternative > is to implement the database specific functions that are required directly > into QM, but I don't like this. > > Alex, anything specific I have to take care of when r2ifying the code? hi Andreas, to be honest I have only "cleaned" it - I have not studied the code enough to give you a real opinion. I can say that I would prefer that datasources not be a global variable - because they will contain passwords, sids, etc. If you look at user/conf/langs.php - you'll see that it sets a cariable in the lang class: I'd like to have it happen the same way with QueryManager. ------- Re changes to the metabase drivers: -John D, JPC? Did you have to do this? Andreas: we might be using a slightly old version of metabase... let me check phpclasses and get back to you :) -a |
From: Andreas A. <a.a...@th...> - 2001-08-17 22:41:34
|
Hi, > I can say that I would prefer that datasources not be a global variable - > because they will contain passwords, sids, etc. Agreed. We dont have to mess up global namespace with this sensitive stuff. Does Init have to be extended? I thought of anohter setting <database>datasources_hook</database> to switch on/off database support. Excatly: to import the metabase stuff and set up querymanager with the database config stored in datasources. > If you look at user/conf/langs.php - you'll see that it sets a cariable in > the lang class: I'd like to have it happen the same way with QueryManager. No problem. Ok I'll have to change that. So QueryManager will become a global like $Lang and not a aggregated-as-needed class. > Andreas: we might be using a slightly old version of metabase... let me > check phpclasses and get back to you :) Hmm, I checked the current version at phpclasses. We need this method in the drivers (e.g. for mysql): Function GetColumnNames($result) { $result_value=intval($result); if(!IsSet($this->columns[$result_value])) { $this->columns[$result_value]=array(); $columns=mysql_num_fields($result); for($column=0;$column<$columns;$column++) $this->columns[$result_value][mysql_field_name($result,$column)]=$column; } } But It's missing in mSql and MySql drivers. Andi |
From: Alex B. <en...@tu...> - 2001-08-17 23:00:55
|
>> I can say that I would prefer that datasources not be a global variable - >> because they will contain passwords, sids, etc. > Agreed. We dont have to mess up global namespace with this sensitive stuff. > > Does Init have to be extended? I thought of anohter setting > <database>datasources_hook</database> > to switch on/off database support. Excatly: to import the metabase stuff and > set up querymanager with the database config stored in datasources. oh, yes, you're right. I'll add a 'database' flag to the init array, and a method to init to import QueryManager. >> If you look at user/conf/langs.php - you'll see that it sets a cariable in >> the lang class: I'd like to have it happen the same way with QueryManager. > No problem. Ok I'll have to change that. So QueryManager will become a > global like $Lang and not a aggregated-as-needed class. Yes... though I am not married to that at the moment, I think it's probably best. >> Andreas: we might be using a slightly old version of metabase... let me >> check phpclasses and get back to you :) > > Hmm, I checked the current version at phpclasses. > We need this method in the drivers (e.g. for mysql): > > Function GetColumnNames($result) > { > $result_value=intval($result); > if(!IsSet($this->columns[$result_value])) > { > $this->columns[$result_value]=array(); > $columns=mysql_num_fields($result); > for($column=0;$column<$columns;$column++) > > $this->columns[$result_value][mysql_field_name($result,$column)]=$column; > } > } > > But It's missing in mSql and MySql drivers. > > Andi I've cc'd manuel on this, see what he says :) -alex |
From: Andreas A. <a.a...@th...> - 2001-08-18 10:41:59
|
Hi Alex, > I'll add a 'database' flag to the init array, and a method to > init to import QueryManager. If you did not already do this. Just wait a bit I've added this already just bevore starting to lift the qm code ":) <page> <init> <database>true</database> </init> <!-- extra <source>hook</source> // hook in datasources <mcrpyt>true</mrcypt> // import metabase mcrypt stuff <manage>false</manage> // import metabase manager classes </database> </page> > > So QueryManager will become a global like $Lang and not a > > aggregated-as-needed class. > Yes... though I am not married to that at the moment, I think > it's probably best. I also think thats best for now. Querymanager does have the capability to load stored queries so there is no real need to have more than one instance of it loaded, I guess. So you define, e.g. in page or entity manager, which queries you need for this pagerender/operation/ety e.g. in page: <database> <queries> <name_of_query>path.to.query</name_of_query) </queries> </database> or something like that. [metabase] > I've cc'd manuel on this, see what he says :) Cool. Andi |
From: John D. <jo...@we...> - 2001-08-18 05:37:36
|
On Fri, 17 Aug 2001, Alex Black wrote: > > > > I have to do minor changes to metabase drivers (GetColumnNames(), oci > > already supports this). QM:_ProccessResult does need this. The alternative > > is to implement the database specific functions that are required directly > > into QM, but I don't like this. > > > > Alex, anything specific I have to take care of when r2ifying the code? > > ------- > > Re changes to the metabase drivers: > > -John D, JPC? Did you have to do this? > Yes, we did have to hack metabase a bit. If you need the hacked versions, you know where you can get them (they also have LOB support which wasn't implemented quite nicely enough to be contributed back to Manuel; cleaning up this would also be a nice 2-3 hour project if someone is interested :)), but it'd be much preferable if we could run off the distributed metabase. -- John Donagher Application Engineer, Intacct Corp. Public key available off http://www.keyserver.net Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD |
From: Alex B. <en...@tu...> - 2001-08-20 19:32:38
|
can you give me an idea of what kind of hacks besides lob? _a > On Fri, 17 Aug 2001, Alex Black wrote: > >>> >>> I have to do minor changes to metabase drivers (GetColumnNames(), oci >>> already supports this). QM:_ProccessResult does need this. The alternative >>> is to implement the database specific functions that are required directly >>> into QM, but I don't like this. >>> >>> Alex, anything specific I have to take care of when r2ifying the code? >> >> ------- >> >> Re changes to the metabase drivers: >> >> -John D, JPC? Did you have to do this? >> > > Yes, we did have to hack metabase a bit. If you need the hacked versions, you > know where you can get them (they also have LOB support which wasn't > implemented quite nicely enough to be contributed back to Manuel; cleaning up > this would also be a nice 2-3 hour project if someone is interested :)), but > it'd be much preferable if we could run off the distributed metabase. |
From: John D. <jo...@we...> - 2001-08-21 00:37:55
|
Sounds like Andi got it working on Oracle without the hacks, so hopefully they aren't necessary.. John On Mon, 20 Aug 2001, Alex Black wrote: > can you give me an idea of what kind of hacks besides lob? > > _a > -- John Donagher Application Engineer, Intacct Corp. Public key available off http://www.keyserver.net Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD |
From: Andreas A. <a.a...@th...> - 2001-08-21 09:33:40
|
Hi John, > Sounds like Andi got it working on Oracle without the hacks, so > hopefully they aren't necessary.. Not really. I did not test on oracle. But the methods required by QueryManager are present in the oci driver file. So i guess it works. I've only testet it with MySQL. Andi |
From: alex b. <en...@tu...> - 2001-08-21 16:33:09
|
I will test with oracle tomorrow. _a ----- Original Message ----- From: "Andreas Aderhold" <a.a...@th...> To: <bin...@li...> Sent: Tuesday, August 21, 2001 2:12 AM Subject: RE: [binarycloud-dev] QueryManager > Hi John, > > > Sounds like Andi got it working on Oracle without the hacks, so > > hopefully they aren't necessary.. > Not really. I did not test on oracle. But the methods required by > QueryManager are present in the oci driver file. So i guess it works. I've > only testet it with MySQL. > > > Andi > > > _______________________________________________ > binarycloud-dev mailing list > bin...@li... > http://lists.sourceforge.net/lists/listinfo/binarycloud-dev > |