Deprecation: #95326 - Various "getInstance()" static methods on singleton interfaces¶
See forge#95326
Description¶
A few classes within TYPO3 Core have a static method get
which acts as a wrapper for the constructor which originally was meant as
a performance improvement as pseudo-singleton concept in TYPO3 v6.
With dependency injection, these classes can be injected or instantiated directly without any performance penalties.
Therefore the following methods have been marked as deprecated:
TYPO3\
CMS\ Core\ Resource\ Index\ Extractor Registry:: get Instance () TYPO3\
CMS\ Core\ Resource\ Index\ File Index Repository:: get Instance () TYPO3\
CMS\ Core\ Resource\ Index\ Meta Data Repository:: get Instance () TYPO3\
CMS\ Core\ Resource\ Online Media\ Helpers\ Online Media Helper Registry:: get Instance () TYPO3\
CMS\ Core\ Resource\ Rendering\ Renderer Registry:: get Instance () TYPO3\
CMS\ Core\ Resource\ Text Extraction\ Text Extractor Registry:: get Instance () TYPO3\
CMS\ Form\ Service\ Translation Service:: get Instance () TYPO3\
CMS\ T3editor\ Registry\ Addon Registry:: get Instance () TYPO3\
CMS\ T3editor\ Registry\ Mode Registry:: get Instance ()
Impact¶
Calling the methods directly in third-party PHP code will trigger a PHP
E_
error.
Affected Installations¶
Any TYPO3 installation with custom PHP code calling the methods are affected.
Migration¶
Check Admin Tools > Upgrade > Scan Extension Files if your
installation is affected and replace calls with constructor injections via
dependency injection if possible, or use
General
instead.