Re: DataObject: Working links.ini and Feature Request
| From: | Alan Knowles | Date: | Fri, 16 Aug 2002 05:36:07 +0000 |
| Subject: | Re: DataObject: Working links.ini and Feature Request | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-8457@lists.php.net to get a copy of this message | ||
There were a couple of little bugs. I've attached a fixed version, that
also changes my Name from Time to Tim, and my email address to the 'public' one. ;)Commited and released the package. comments inline..
###START_AUTOCODE and ###END_AUTOCODE| I think the only way it would know the difference is if it did a serialize of the table data array and compared before/after.When the generator re-writes the class files it only touches the stuff betweenHrm. I see what you are doing here, and I think it would work, assuming that Generator 'edits' the class files, rather than replacing them. i.e. if you have added code after the 'autocode' end, you don't have to readd it every time. I think it would pay to be able to specify which tables to run against in this situation, say all with or without a certain prefix - so I don't keep getting classes and .ini tables for tables that happen to be in the same database but aren't actually part of the app.I've added a production option to the class, mainly cause when I was profiling it, the debug(), call was getting hammered... I think there may be some way to do this.. if (!DB_DATAOBJECT_PRODUCTION) {require_once 'DB/DataObject/Generator.php'; DB_DataObject_Generator::start(); }inside the staticDefineProduction(); ... - maybe rename this staticInitialize();
I also like it because it would mean that someone could get started with DataObject without explicitly running Generator themselves first.The only trouble here is that the files would have to be writable by apache.. - which they are currently not... the other option I guess would just be to flag and die if there was a difference....
A note on config files - I have found it much more useful to have two separate config files, one with the [DataObjects] section, and one with the database specific stuff.not sure what you mean here.. - have you combined the generated ini file with the config file?
[DB_DataObject_IniMap] myspecialdb = standarddb regards alanHowever, I also have run up against situations where the database name needs to be changeable, and yet I don't want to have to regenerate the .ini file. I'd like to have a [DataObjects] option to specify the name of the database .ini file (and links .ini), with it defaulting to <dbname.ini> as it does now.mmh a section like ?