To follow-up on this discussion, Jordi and I worked on a patch to provide a solution for these issues. Basically, we have reverted some of the changes that were done when the event dispatcher was changed to a Doctrine modified version:

* The event name is now decoupled from the method name (a listener can be any valid PHP callback);

* The event constant values are now namespaced strings like 'core.request', 'core.response', ... instead of the single event name/constant name/method name.

As this patch is obviously not backward compatible, you are all encouraged to update your bundles to take it into account as soon as possible:

https://github.com/symfony/symfony/pull/1153

The patch is available in the 'events' branch (https://github.com/symfony/symfony/tree/events). The changes for most bundles should be fairly minimal: for an example, FrameworkExtraBundle has been updated in the 'events' branch (https://github.com/sensio/SensioFrameworkExtraBundle/compare/master...events).

This patch will land into master tomorrow and will be available in the beta4 release, which is due at the end of this week (or on Monday at the latest).

Fabien

--
Fabien Potencier
Sensio CEO - Symfony lead developer
sensiolabs.com | symfony.com | fabien.potencier.org
Tél: +33 1 40 99 80 80

On 5/2/11 9:46 PM, Jordi Boggiano wrote:
On Mon, May 2, 2011 at 9:40 PM, Johannes Schmitt<[email protected]>  wrote:
One of the the pros for these Events classes is that you have
auto-completion for which events are available. That's really the only
purpose these classes serve, and imo it is a good thing.

However, there is a chance for conflicts, but I think this is more a
documentation issue; we probably have to create a naming convention for
events to make sure people do not create conflicting names.

Well ok but why not have the strings just be event identifiers, so
they can be long and namespaced and whatever, and then we attach
listeners with an identifier + a callback.

Why is there this method name = event identifier restriction?

Cheers


--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to