[TASK] Consolidate singleton retrieval
There is Bootstrap::getInstance()->getEarlyInstance() and GeneralUtility::makeInstance() to retrieve (global) early instances. Sometimes the former, sometimes the latter is used (e.g. to retrieve the PackageManager). Classes should not know whether something is an early instance or not. Implementation details like that should be abstracted into a singleton container. That (currently) is GeneralUtility::makeInstance(). As there is no obvious reason why different methods are used, we now use GenerallyUtility::makeInstance() to retrieve singletons. Add all early singleton instances to the GeneralUtility singleton array and stop using Bootstrap::getEarlyInstance in classes outside Bootstrap. One exception to this is the composer ClassLoader. That (obviously) does not implement the TYPO3 SingletonInterface. We now push that instance to ClassLoadingInformation during the bootstrap. (similar to how the PackageManager is pushed to the ExtensionManagementUtility). Releases: master Resolves: #83966 Change-Id: Icf3bef5f51a6142d9d1dcdc9b3700a86d7bb7f78 Reviewed-on: https://review.typo3.org/55802 Tested-by:TYPO3com <no-reply@typo3.com> Reviewed-by:
Frank Naegler <frank.naegler@typo3.org> Tested-by:
Frank Naegler <frank.naegler@typo3.org> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/Core/Bootstrap.php 7 additions, 7 deletionstypo3/sysext/core/Classes/Core/Bootstrap.php
- typo3/sysext/core/Classes/Core/ClassLoadingInformation.php 18 additions, 3 deletionstypo3/sysext/core/Classes/Core/ClassLoadingInformation.php
- typo3/sysext/core/Classes/Package/DependencyResolver.php 2 additions, 3 deletionstypo3/sysext/core/Classes/Package/DependencyResolver.php
- typo3/sysext/install/Classes/Controller/InstallerController.php 1 addition, 1 deletion...sysext/install/Classes/Controller/InstallerController.php
- typo3/sysext/install/Classes/Http/Application.php 1 addition, 2 deletionstypo3/sysext/install/Classes/Http/Application.php
Please register or sign in to comment