PHP 5.3 Due out Thursday. Namespaces?
2009-06-23 14:42:34 GMT
The PHP mailing list had a recent post indicating that aside from any surprises they intend to release PHP 5.3 stable into the wild.
This brings back to the forefront the issue of namespace support in Propel and I'd like to see us release a namespace compatible release not too far after 5.3 is released.
I've been using the implementation internally for a few months now and feel pretty good with it. One feature related to namespaces that we talked about was the ability to override namespaces on a per-table basis. A couple months ago I indicated that doing that configuration in the schema.xml didn't make much sense because, to me and a few other devs, the schema.xml is all about database meta-data. I've since put that ability into the .properties file. I know there was discussion about changing the INI format to XML but I think we agreed to take that on as a separate effort.
That said, the only uncommitted code I have allows you to override the namespace for a set of models with the following syntax (this is a working sample I'm using):
propel.table.tag.namespace.base = ${propel.namespace.pluginbase}\tagging
propel.table.tag.output.dir = plugins/tagging/models
Starting with the second line, it specifies the output directory relative to propel.output.dir
The first line sets the namespace for a table called "tag" which is based on the following default values:
propel.namespace.enabled = true
propel.namespace.base = \MyProject
propel.namespace.pluginbase = ${propel.namespace.base}\Plugin
propel.namespace.default.om = Model
propel.namespace.default.peer = Model
propel.namespace.default.map = Model
This essentially makes it a snap for people developing plugin-based packages or bigger non-plugin based systems that would like to better organized their model objects.
So for the Dev's I'd like some comments/feedback on this and, if not argument, a green light to commit this.
For you folks out in user-land, I'd like to encourage testing of namespace support (minus the namespace override above) once 5.3 hits the street.
--
Tony Bibbs
Phone: 515.554.8046
Twitter, Skype, Facebook: tonybibbs
Web: http://www.tonybibbs.com
http://www.apteno.net
RSS Feed