Skip to content
Snippets Groups Projects
Commit 49aee1ae authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 92eba220
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment