SensioFrameworkExtraBundle
SensioFrameworkExtraBundle copied to clipboard
[RFC] Allow configuration of listeners priority
Currently all listeners have priority of 0. This makes it impossible (without server definition hacks) to insert another listener between them (for example I needed a listener between param converter and security).
I suggest to change the tags from kernel.event_subscriber
to kernel.event_listener
and allow for configuration of priority, This can be either though parameters or configuration options. By default put 0 to align with current setup
My only concern is the possible BC break as other libraries might rely on priority being hard coded to zero. On other hand since it's configuration by user/developer it shouldn't that big of problem. Also is removal of \Symfony\Component\EventDispatcher\EventSubscriberInterface
a BC break?
I can make a PR
I think I'm also running into this issue when upgrading because of HttpCacheBundle expecting ControllerListener
[RuntimeException]
Tag support requires SensioFrameworkExtraBundleΓÇÖs ControllerListener for the annotations. Please install sensio/framework-extra-bundle and add it to your AppKernel.
@The-Don-Himself the problem with not seeing the listener is fixed in https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/395
@Xymanek this will be hard to accept due to BC. Can you give us an exact use case for what you need to achieve?
@jakzal before a user can access a page he needs to pass two checks (in this order):
- Is he on a plan that allows use of this page? if not -> 404
- Does he have permission to access this page? if not -> 403
I'm using @Security
for 2nd and @ParamConverter
for 1st. However since they both have same priority it's very hard to put something (feature grant check in my case) between them