Fwd: [Fwd: Re: [PEAR] DataObject tweak ok with DB and MDB2]
| From: | Dan Rossi | Date: | Wed, 06 Apr 2005 03:13:32 +0000 |
| Subject: | Fwd: [Fwd: Re: [PEAR] DataObject tweak ok with DB and MDB2] | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18531@lists.php.net to get a copy of this message | ||
i tried sending this before
Begin forwarded message:
From: Pear List <pear@electroteque.org> Date: 6 April 2005 9:58:57 AM To: <pear@electroteque.org> Subject: [Fwd: Re: [PEAR] DataObject tweak ok with DB and MDB2] -------- Original Message -------- Subject: Re: [PEAR] DataObject tweak ok with DB and MDB2 From: <pear@electroteque.org> Date: Wed, April 6, 2005 9:55 am To: <pear-general@lists.php.net >On Apr 5, 2005 2:35 PM, Dan Rossi <pear@electroteque.org> wrote:On 06/04/2005, at 4:07 AM, Justin Patrin wrote:If we cast it twice I don't think that's a problem. IMHO it's better to have leff ifs in the code for the different DBs.Ok no problem.Not sure what you're asking here. I've never used db_options, honestly. You're right, though, if it's currently just db_options you shouldn't be changing it to a nested array.Ok db_options is most important for MDB2, it sends the portability option which lowercases yourfields, i use uppercase ID for keys ie fieldID which breaks having this option on so i need to turn itoff, what is the best way to collect db_options then ? initially its calling it from DB directly, but howdoes DB collect options coz it doesnt , therefore db_options was null. What is the best way to dothis then ? Here is my xml settings <DB_DataObject> <database></database> <schema_location>/www_tools/apache/htdocs/complaints/classes/DataObjects/</ schema_location> <class_location>/www_tools/apache/htdocs/complaints/classes/DataObjects/</ class_location> <require_prefix>DataObjects/</require_prefix> <class_prefix>DataObjects_</class_prefix> <database_complaints></ database_complaints> <ignore_sequence_keys></ignore_sequence_keys> <extends_location></extends_location> <extends></extends> <proxy>full</proxy> <generator_class_rewrite></generator_class_rewrite> <debug>0</debug> <debug_force_updates>0</debug_force_updates> <production>0</production> <db_driver>MDB2</db_driver> <MDB2> <portability>0</portability> <persistent>true</persistent> </MDB2> </DB_DataObject>Well...yes, it should be more efficient, and it's also just a better check. It's better for us to if/switch on the option than to check the object to see if it has a method.Ok i had initially done config checks, but though the other way was faster :)The source file I put up is the full source of my changed version (all of my changes to your code are applied). The diff file is mostly for Alan's benefit so he can see what we changed since his latest CVS version. You can apply patches with the "patch" utility. ;-) It *may* not work, though as my filenames are probably off. I mostly use diffs as a reference anyway. But you would need the CVS version of DB_DataObject, not your altered copy to apply the patch. Better to just grab my source and work from that.Yeh i am collecting it now, i'll do somemore tweaks and then let you do the patches then, we mayneed Alan to comment on this, I DONT want to shoe in on someone elses project without theirpermission but if it helps everyone great. I am fully aware that DB_DataObject will be replaced thewith DBDO extension interfacing with the PDO extension for PHP5, I am also aware that Lukas hasBC broken his MDB2 to be method compliant with PDO but no breakages as yet. I had to move backfrom MDB2_DataObject to DB_DataObject because it became painful to diff and to keep standardnaming conventions.