Description
Q | A |
---|---|
Bug report? | no |
Feature request? | no |
BC Break report? | no |
RFC? | yes |
Symfony version | 3.4 and\or 4.0 |
Hi, I'm currently working on some kind of RPC server bundle stack on top of symfony and I have a simple internal method routing, which generally repeats the symfony one's. I say repeats but not re-uses (which I hope to do initially), since the current routing have several limitations:
-
Controller Resolver signature requires the whole
Request
object, but really it uses only_controller
attribute value, can we pass it instead? TheRequest
object is used only to build Exception message withgetPathInfo
call, but I think we can overcome it with rethrow on higher level or just refactor it out. Most of the exceptions, thrown byControllerResolver
do not use thePathInfo
to construct the message. -
Controller Name Parser signature hardcodes the
Controller\*Controller::*Action
controler layout and it is even not configurable. Replacing this layout to another (or making this configurable) leads to full class override with copy&paste despite of the fact it is open for inheritance. we can make action guessing and action parsing to be protected methods, which define the layout
I also have some thoughts on decoupling Route
from HTTP since most of the routing loading process could be fully reused for creating internal routing, but the current Route
class is all about HTTP routing (i.e it modifies path to match URI format), but I haven't fully formalized this thoughts yet
I hope we can make the components a bit more decoupled with this ideas.
WDYT?