Fwd: Moving settings from from schema.xml to property files
Tony Bibbs <tony <at> tonybibbs.com>
2009-04-16 15:59:33 GMT
Fellow devs,
With the looming PHP5.3 release there is one thing yet to be cleaned
up in the Propel codebase. As many of you know I committed namespace
support into the trunk some time ago. You can now set the default
namespace for OM, Peer, Maps, etc. The only thing missing is the
ability to override a namespace on a per-table basis.
My original thought was to just add a "namespace" attribute on the
<table> tag in schema.xml. This, however, is a bit confusing when
used in conjunction with the "package" attribute which, to new Propel
users, might seem like the same thing. My original way to fix this
was to simply deprecate the use of the "package" attribute and use
something like an "outputDIrectory" attribute instead. In an IRC
chat with Ron, he came up with I felt was a good way to not only fix
this specific problem but to clean things up a bit: put it all in
property files.
The idea is that schema.xml would only contain meta data describing
the database. This may not seem like a deviation from today but the
notable change in philosophy is that anything related to how
files get built or where files are outputted to would be moved to
property files. The idea then is we'd have settings like:
table.blogpost.namespace = \MyApp\Plugins\Blog
table.blogpost.outputDirectory = /path/to/MyApp/plugins/Blog/
Only draw back I see is in the case where you rename a table. That'd
mean you'd have to touch both the schema.xml and (possibly) the
properties file. I say possibly there because we'd have default
settings so you'd only have to specify any overrides. I think to make
this easier on Propel users we could simply give build
warnings when we find any table.foo references that don't match an
existing table.
Oh, and before we get too far, the table.foo notation above is only
for sample purposes. How we'd structure those would, obviously, be up
for discussion. Ron and I just wanted to float this general solution
out to you all for comment.
--
--
Tony Bibbs
Phone: 515.554.8046
Twitter, Skype, Facebook: tonybibbs
Web: http://www.tonybibbs.com
http://www.apteno.net
------------------------------------------------------
http://propel.tigris.org/ds/viewMessage.do?dsForumId=1093&dsMessageId=1749560
To unsubscribe from this discussion, e-mail: [dev-unsubscribe <at> propel.tigris.org].