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 the`Entrypoint\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.~~ fixed: https://gitlab.com/foodsharing-dev/foodsharing/-/issues/1880 ~~Some controllers are routed even weirder; a rewrite in our reverse proxy `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.~~ (all of these have been fixed: foodsharing#1780) # A list of all remaining "legacy" controllers: - [x] StoreUserControl.php - [x] SettingsControl.php - [x] BasketControl.php - [x] MailboxControl.php - [x] RegionAdminControl.php - [x] VotingControl.php - [x] QuizControl.php - [x] FoodSharePointControl.php - [x] MessageControl.php - [x] LogoutControl.php - [x] BlogControl.php - [x] DashboardControl.php - [x] RegisterControl.php - [x] ProfileControl.php - [x] StoreChainControl.php - [x] IndexControl.php - [x] ReportControl.php - [x] ApplicationControl.php - [x] WorkGroupControl.php - [x] BusinessCardControl.php - [x] LegalControl.php - [x] EventControl.php https://gitlab.com/foodsharing-dev/foodsharing/-/merge_requests/3260 - [x] LoginControl.php - [x] ReloginControl.php - [x] StoreControl.php ### Out of those, these have rewrites in nginx: * [x] LoginControl.php * [x] ProfileControl.php * [x] BlogControl.php * [x] JoinControl.php -- this is gone (already?), remove the rewrite and special route * [x] FoodSharePointControl.php * [x] BasketControl.php ### And out of those few, these use UriHelper: * [x] ProfileControl.php * [x] FoodSharePointControl.php * [x] BasketControl.php ### Unrelated (ConsoleControl): - [x] ConsoleControl - [x] MailsControl - [x] LookupControl - [x] StatsControl - [x] MaintenanceControl
epic