Tony Bibbs | 23 Jun 2009 16:42
Gravatar

PHP 5.3 Due out Thursday. Namespaces?

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

Hans Lellelid | 24 Jun 2009 01:20

Re: [propel-dev] PHP 5.3 Due out Thursday. Namespaces?

Hi folks,

Tony Bibbs wrote:
> 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 <http://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.

Does anyone have any strong opinion on this?   Personally it seems a bit 
awkward to do this in the ini file.  While I agree that schema.xml is 
really for database stuff, it's currently the only data structure we 
have that represents things in a sensible per-table sort of way.  We do 
also have some attributes in there that describe the *mapping* and not 
the database -- e.g. the peerName/phpName the inheritance stuff is all 
related to the generated objects and not the database.  However, I agree 
with the sentiment of separating out PHP directives from database 
directives, so I'm not particularly passionate about either argument :)

Hans

------------------------------------------------------
http://propel.tigris.org/ds/viewMessage.do?dsForumId=1097&dsMessageId=2364744

To unsubscribe from this discussion, e-mail: [users-unsubscribe <at> propel.tigris.org].

Tony Bibbs | 30 Jun 2009 19:43
Gravatar

Re: [propel-dev] Re: PHP 5.3 Due out Thursday. Namespaces?

Ok, so 5.3 got dropped today.  I'd like those of you in the Propel community to take a look at 5.3 and the SVN snapshot.

One wrinkle, however, is this set of standards agreed upon but quite a few prominent PHP'ers:

http://news.php.net/php.standards/2

We'll probably want to work those into Propel but I'd like to hold off doing anything with it until we get feedback on my original email and Hans' response below.

--Tony

On Tue, Jun 23, 2009 at 6:20 PM, Hans Lellelid <hans <at> velum.net> wrote:

Hi folks,

Tony Bibbs wrote:
> 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 <http://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.

Does anyone have any strong opinion on this?   Personally it seems a bit
awkward to do this in the ini file.  While I agree that schema.xml is
really for database stuff, it's currently the only data structure we
have that represents things in a sensible per-table sort of way.  We do
also have some attributes in there that describe the *mapping* and not
the database -- e.g. the peerName/phpName the inheritance stuff is all
related to the generated objects and not the database.  However, I agree
with the sentiment of separating out PHP directives from database
directives, so I'm not particularly passionate about either argument :)

Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Propel Development" group.
To post to this group, send email to propel-development <at> googlegroups.com
To unsubscribe from this group, send email to propel-development+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.nl/group/propel-development?hl=en
-~----------~----~----~----~------~----~------~--~---




--
Tony Bibbs
Phone: 515.554.8046
Twitter, Skype, Facebook: tonybibbs
Web: http://www.tonybibbs.com
        http://www.apteno.net


Gmane