[TASK] Consolidate singleton retrieval 02/55802/7
authorBenjamin Franzke <bfr@qbus.de>
Sat, 17 Feb 2018 21:43:01 +0000 (22:43 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 26 Feb 2018 15:43:51 +0000 (16:43 +0100)
commit49aee1ae22cc9db1cd449e055356e1e30b0bce73
treec512689f3dc0da01e7f19a02b28140521cdd0e69
parent92eba220755e6b80aa483d1728e70097921b630f
[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>
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/ClassLoadingInformation.php
typo3/sysext/core/Classes/Package/DependencyResolver.php
typo3/sysext/install/Classes/Controller/InstallerController.php
typo3/sysext/install/Classes/Http/Application.php