76537[FEATURE] Introduce PHP attribute based backend controller registration
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Stefan Bürk +1
-
Verified V +2 Done
- Benni Mack +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 38
- typo3/sysext/backend/Classes/Attribute/Controller.phpnew+33 −0
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php+2 −0
- typo3/sysext/backend/Classes/Controller/File/FileController.php+2 −0
- typo3/sysext/backend/Classes/Controller/Page/NewMultiplePagesController.php+2 −0
- typo3/sysext/backend/Classes/Controller/Page/SortSubPagesController.php+2 −0
- typo3/sysext/backend/Classes/Controller/Wizard/ImageManipulationController.php+2 −0
- typo3/sysext/backend/Classes/Controller/AboutController.php+2 −0
- typo3/sysext/backend/Classes/Controller/AjaxLoginController.php+2 −0
- typo3/sysext/backend/Classes/Controller/BackendController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ClipboardController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ColumnSelectorController.php+2 −0
- typo3/sysext/backend/Classes/Controller/DummyController.php+2 −0
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ElementBrowserController.php+2 −0
- typo3/sysext/backend/Classes/Controller/FormFilesAjaxController.php+2 −0
- typo3/sysext/backend/Classes/Controller/FormSlugAjaxController.php+2 −0
- typo3/sysext/backend/Classes/Controller/LiveSearchController.php+2 −0
Show 18 more files
- typo3/sysext/backend/Classes/Controller/LoginController.php+2 −0
- typo3/sysext/backend/Classes/Controller/LogoutController.php+2 −0
- typo3/sysext/backend/Classes/Controller/MfaAjaxController.php+2 −0
- typo3/sysext/backend/Classes/Controller/MfaConfigurationController.php+2 −0
- typo3/sysext/backend/Classes/Controller/MfaController.php+2 −0
- typo3/sysext/backend/Classes/Controller/MfaSetupController.php+2 −0
- typo3/sysext/backend/Classes/Controller/NewRecordController.php+2 −0
- typo3/sysext/backend/Classes/Controller/PageLayoutController.php+2 −0
- typo3/sysext/backend/Classes/Controller/RecordListController.php+2 −0
- typo3/sysext/backend/Classes/Controller/RecordListDownloadController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ResetPasswordController.php+2 −0
- typo3/sysext/backend/Classes/Controller/ShortcutController.php+2 −0
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php+2 −0
- typo3/sysext/backend/Classes/Controller/SwitchUserController.php+2 −0
- typo3/sysext/backend/Classes/Controller/SystemInformationController.php+2 −0
- typo3/sysext/backend/Configuration/Services.php+10 −0
- typo3/sysext/backend/Configuration/Services.yaml+0 −102
- typo3/sysext/core/Documentation/Changelog/12.1/Feature-99055-BackendControllerServiceTagAttribute.rstnew+40 −0
Review log 3046
Show 1221 earlier messages
-
Bastien Lutz uploaded patch set 1 11/10/22, 11:18
-
core-ci voted on patch set 1 V -1 11/10/22, 11:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33459
-
Bastien Lutz uploaded patch set 2 11/10/22, 11:30
-
Bastien Lutz uploaded patch set 3 11/10/22, 11:31
-
core-ci voted on patch set 2 V -1 11/10/22, 11:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33461
-
core-ci voted on patch set 3 V -1 11/10/22, 11:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33463
-
Bastien Lutz uploaded patch set 4 11/10/22, 12:04
-
Bastien Lutz updated the commit message in patch set 5 11/10/22, 12:04
-
Benjamin Franzke commented on patch set 5 11/10/22, 12:36
Hey, thanks for the change. Tags are quite generic and I think it would be better to create distinct attribute for the respective tags (for sure, that's more work) Advantages would be * Tags Attributes would be easy to deprecate and autocomplete (IDE users will be happy about that) * The arguments for the Attributes could use proper typings and could be expressed as native attribute for the tag. That would not be possible with a generic AddTags attribute. So take a look at tags like 'console.command' which require additional settings like 'command' and 'description'Tags do not cause any autowiring, tags are used to register services (for usage by registries). -
core-ci voted on patch set 4 V -1 11/10/22, 12:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33475
-
core-ci voted on patch set 5 V -1 11/10/22, 12:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33478
-
Bastien Lutz uploaded patch set 6 11/10/22, 15:08
-
Bastien Lutz updated the commit message in patch set 7 11/10/22, 15:13
-
Oli Bartsch commented on patch set 7 11/10/22, 15:25
Please let's have a feature RST. You can take a look at https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/AddingDocumentation/Index.html#add-documentation for more information.AddTags.php:23This class is not dedicated to backend controller configuration, right? -
core-ci voted on patch set 6 V -1 11/10/22, 15:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33504
-
core-ci voted on patch set 7 V -1 11/10/22, 15:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33505
-
Bastien Lutz uploaded patch set 8 11/10/22, 15:45
-
core-ci voted on patch set 8 V +1 11/10/22, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33512
-
Bastien Lutz uploaded patch set 9 11/10/22, 16:28
-
core-ci voted on patch set 9 V +1 11/10/22, 16:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33519
-
Chris Müller commented on patch set 9 11/10/22, 16:46
Is there a reason calling the attribute "AsBackendController" and not just "BackendController"?
-
Bastien Lutz commented on patch set 9 11/10/22, 17:35
Reply
Hi, ok, sounds great. To begin with i would start off with the tag 'backend.controller'. We can still add some in the future as you said.Reply
DoneReply
Because it should be tagged AS a BackendController. My intention was to give it a name which doesn't make a class appear unique, because this would give an impression of overwriting something. But i still wanted a name which sounds like the classes are following a pattern. And i also was inspired by the AsController PHP Attribute from Symfony. But technically there isn't any reason why it is called AsBackendController and not BackendController.Reply
DoneAddTags.php:23ReplyDone -
Benjamin Franzke commented on patch set 9 11/11/22, 09:16
Reply
I'd love to use: use TYPO3\CMS\Core\Attribute; #[Attribute\BackendController] class MyBackendController But that's only nice when all tags are located in EXT:core, which is probably not doable, especially when we think of extensions which will use the same paradigm for their registriert. I think the attribute needs to be provided by EXT:backend and then we can actually drop the "Backend" in the Attribute name, that is clear from the context: TYPO3\CMS\Backend\Attribute\Controller. Why not using As? Well, it's only symfony doing so, and we wouldn't do that for all Attributes, only interface-like attribute. So I'd rather use proper namespaces and to suffixes or prefixes, like the examples on https://www.php.net/manual/en/language.attributes.overview.php do. Usage could then be: use TYPO3\CMS\Backend\Attribute\Controller as ControllerAttrib; Or if you feel that's not expressive enough (for the context of the class): use TYPO3\CMS\Backend\Attribute\Controller as BackendControllerAttrib; -
Chris Müller uploaded patch set 10 11/11/22, 09:27
-
core-ci voted on patch set 10 V +1 11/11/22, 09:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33556
-
Benni Mack commented on patch set 10 11/11/22, 09:45
Reply
I agree with "use TYPO3\CMS\Backend\Attribute\Controller" or "use TYPO3\CMS\Backend\Attribute\ControllerAttribute" -
Bastien Lutz uploaded patch set 11 11/11/22, 16:41
-
Bastien Lutz commented on patch set 11 11/11/22, 16:43
Reply
i ajusted the naming -
core-ci voted on patch set 11 V +1 11/11/22, 16:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33599
-
Benni Mack commented on patch set 11 11/11/22, 22:32
tbh, I like the "Controller" way better than the "use ... as BackendControllerAttrib", with an IDE it's good to use. -
Stefan Bürk commented on patch set 11 11/13/22, 01:05
Feature-99055-BackendControllerServiceTagAsAttribute.rst:7The "=" lines must have the same length as the text in-between. Thus two "=" should be removed from L5 and L7 -
Stefan Bürk commented on patch set 12 11/13/22, 01:05
Published edit on patch set 11. -
core-ci voted on patch set 12 V +1 11/13/22, 01:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33660
-
Stefan Bürk commented on patch set 12 11/13/22, 01:36
Feature-99055-BackendControllerServiceTagAsAttribute.rst:7ReplyDone -
Stefan Bürk updated the commit message in patch set 13 11/13/22, 01:36
-
core-ci voted on patch set 13 V +1 11/13/22, 01:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33661
-
Stefan Bürk updated the commit message in patch set 14 11/13/22, 01:46
-
core-ci voted on patch set 14 V +1 11/13/22, 01:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33662
-
Stefan Bürk uploaded patch set 15 11/13/22, 02:41
-
core-ci voted on patch set 15 V +1 11/13/22, 02:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33664
-
Stefan Bürk rebased onto patch set 16
V +111/22/22, 23:41 -
core-ci voted on patch set 16 V +1 11/22/22, 23:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34089
-
Stefan Bürk voted on patch set 16 V +1 CR +1 11/23/22, 00:45
-
Stefan Bürk commented on patch set 16 11/23/22, 00:45
Nice patch. Thanks for the hard work on it @Bastien. -
Benni Mack voted on patch set 16 V +2 CR +2 11/23/22, 14:01
-
Benni Mack merged patch set 17 11/23/22, 14:01