On 1/23/11 4:01 PM, Johannes wrote:
Right now, the kernel listeners are always instanciated and passed to
the event dispatcher which then calls a ->register() method on them to
let them register themself. This way all kernel listeners are always
instanciated even if their respective events never get called.
We could change the behavior in that we introduce a new tag which
contains already the event the listener wants to register for, it's
priority, and the method on the service instance that is supposed to
be called, e.g.
<tag name="kernel.event_listener" event="core.request" priority="0"
method="handle" />
<tag name="kernel.event_listener" event="core.response" priority="12"
method="alterResponse" />
That would make the event dispatcher more lightweight and would allow
it to lazy-load only those listeners which it actually needs.
I thought about that as well a few times, but it feels a bit wrong as
the listener class itself is then not self-contained anymore. Anyway,
that's probably a good compromise if we at least add the information
from the tag in the listener PHPDoc also.
And of course, in that case, adding an event for priming the cache is
the way to go.
Fabien
Kind regards,
Johannes
--
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