Port controllers to native Symfony controllers
To get rid of the complicated bridging from Symfony land to our bespoke module/controller structure, we should migrate all of our controllers (*Control classes) to "native" Symfony controllers.
This is currently complicated by our URL/routing scheme (see theEntrypoint\IndexController
and Routing
classes for the code responsible for that), which acts purely based on query parameters (e.g. /?page=settings
. Symfony's router does not support matching those, and expects /path/based/routes
instead.
Because all the controllers are routed through the page
parameter, we can convert their paths from e.g. /?page=settings
to /settings
and keep all the other query parameters.
This is unfortunately further complicated by the sub
mechanism that is also part of our routing scheme, which determines which class method will be called in addition to, or instead of an optional index
method. This needs to be handled on a case by case basis, unfortunately.
Also, an a
parameter allows overriding the default index
method always called. Not many instances of this exist, fortunately, but an eye should be kept out for those as well.
Some controllers are routed even weirder; a rewrite in our reverse proxy (all of these have been fixed: #1780 (closed))nginx
turns a /path/based/route
into a /?page=abc
route and appends the original URI as an extra query parameter. This parameter may then be parsed by the controller through the UriHelper
to get e.g. an ID embedded in the path. Symfony can do this for us, and due to routing specifics it can fortunately take over without requiring simultaneous changes to the nginx config.
A list of all remaining "legacy" controllers:
-
FoodsaverControl.php -
StoreUserControl.php -
SettingsControl.php -
BasketControl.php -
MailboxControl.php -
RegionAdminControl.php -
VotingControl.php -
QuizControl.php -
FoodSharePointControl.php -
MessageControl.php -
LogoutControl.php -
BlogControl.php -
DashboardControl.php -
RegisterControl.php -
ProfileControl.php -
StoreChainControl.php -
IndexControl.php -
ReportControl.php -
ApplicationControl.php -
WorkGroupControl.php -
BusinessCardControl.php -
LegalControl.php -
PassportGeneratorControl.php -
EventControl.php -
LoginControl.php -
EmailControl.php -
ReloginControl.php -
StoreControl.php
Out of those, these have rewrites in nginx:
-
LoginControl.php -
ProfileControl.php -
BlogControl.php -
JoinControl.php -- this is gone (already?), remove the rewrite and special route -
FoodSharePointControl.php -
BasketControl.php
And out of those few, these use UriHelper:
-
ProfileControl.php -
FoodSharePointControl.php -
BasketControl.php
Unrelated (ConsoleControl):
-
ConsoleControl -
MailsControl -
LookupControl -
StatsControl -
MaintenanceControl