[TASK] Instantiate $GLOBALS[LANG] via factory
LanguageService a.k.a. $GLOBALS[LANG] is used in various places, not just for backend-labels anymore. The "init()" method (which stems from the fact that PHP did not have constructors !!! back then), should be covered - which is now done via factory methods. The goal of the factory methods are to explicitly define the dependencies where LanguageService is used, instead of calling "init()" in the emitters code. This change is a pre-cursor for TYPO3 to - avoid accessing Bootstrap API for initializing $GLOBALS[LANG] - streamline the various places where this API is instantiated - have a first step to switch to "real" locales at _some_ point - and eventually get rid of accessing LanguageService via globals. In addition the PHP class comments are streamlined to reflect the purpose of this class. The next step is to adapt the testing framework to easily use this API so our tests will not have to worry about $GLOBALS[LANG] anymore. My 2c: We should actually rename "LanguageService" to "LabelService" or "LabelProvider" at some point. Resolves: #90062 Releases: master Change-Id: Ib1b6a8aacb2c2aecc3ab2931db04002dd02f0a99 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62826 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Jörg Bösche <typo3@joergboesche.de> Tested-by:
Sascha Rademacher <sascha.rademacher+typo3@gmail.com> Tested-by:
Henning Liebe <h.liebe@neusta.de> Tested-by:
Susanne Moog <look@susi.dev> Reviewed-by:
Jörg Bösche <typo3@joergboesche.de> Reviewed-by:
Sascha Rademacher <sascha.rademacher+typo3@gmail.com> Reviewed-by:
Henning Liebe <h.liebe@neusta.de> Reviewed-by:
Susanne Moog <look@susi.dev>
Showing
- typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php 2 additions, 1 deletion...t/backend/Classes/Middleware/BackendUserAuthenticator.php
- typo3/sysext/core/Classes/Console/CommandApplication.php 2 additions, 1 deletiontypo3/sysext/core/Classes/Console/CommandApplication.php
- typo3/sysext/core/Classes/Console/CommandRequestHandler.php 2 additions, 1 deletiontypo3/sysext/core/Classes/Console/CommandRequestHandler.php
- typo3/sysext/core/Classes/Core/Bootstrap.php 2 additions, 2 deletionstypo3/sysext/core/Classes/Core/Bootstrap.php
- typo3/sysext/core/Classes/Information/Typo3Information.php 1 addition, 3 deletionstypo3/sysext/core/Classes/Information/Typo3Information.php
- typo3/sysext/core/Classes/Localization/LanguageService.php 44 additions, 4 deletionstypo3/sysext/core/Classes/Localization/LanguageService.php
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 3 additions, 6 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
- typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php 2 additions, 1 deletion.../frontend/Classes/Middleware/BackendUserAuthenticator.php
- typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php 1 addition, 0 deletions...ests/Unit/Controller/TypoScriptFrontendControllerTest.php
- typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php 0 additions, 12 deletionstypo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
- typo3/sysext/install/Classes/Controller/SettingsController.php 2 additions, 2 deletions.../sysext/install/Classes/Controller/SettingsController.php
- typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php 2 additions, 2 deletions...rte_ckeditor/Classes/Controller/BrowseLinksController.php
Please register or sign in to comment