[TASK] Deprecate GeneralUtility::getUserObj() 18/52518/3
authorBenni Mack <benni@typo3.org>
Thu, 20 Apr 2017 13:47:18 +0000 (15:47 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 27 Apr 2017 15:02:11 +0000 (17:02 +0200)
This function now does the same as makeInstance() except for an if()
clause, since the API should be unified this method should be considered
as dropped, allowing to use callUserFunction() and makeInstance() as the
only two proper ways to call custom classes / methods.

Resolves: #80993
Releases: master
Change-Id: I0c2042dbe6c83a86f211bab4eaf64d75e6424232
Reviewed-on: https://review.typo3.org/52518
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
49 files changed:
typo3/sysext/about/Classes/Controller/ModulesController.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Controller/FileDumpController.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectApi.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectRouter.php
typo3/sysext/core/Classes/FrontendEditing/FrontendEditingController.php
typo3/sysext/core/Classes/Html/RteHtmlParser.php
typo3/sysext/core/Classes/Imaging/IconFactory.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-80993-GeneralUtilitygetUserObj.rst [new file with mode: 0644]
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Hooks/MediaItemHooks.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/linkvalidator/Classes/LinkAnalyzer.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/reports/Classes/Report/Status/SystemStatus.php
typo3/sysext/rsaauth/Classes/Backend/BackendFactory.php
typo3/sysext/rsaauth/Classes/Storage/StorageFactory.php
typo3/sysext/saltedpasswords/Classes/Salt/SaltFactory.php
typo3/sysext/saltedpasswords/Classes/Utility/ExtensionManagerConfigurationUtility.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/typo3db_legacy/Classes/Database/DatabaseConnection.php
typo3/sysext/version/Classes/Hook/DataHandlerHook.php
typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php

index 50de1fc..069f210 100644 (file)
@@ -75,8 +75,8 @@ class ModulesController extends ActionController
         $securityWarnings = '';
         // Hook for additional warnings
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
                     $hookObj->displayWarningMessages_postProcess($warnings);
                 }
index a036b89..5a46e36 100644 (file)
@@ -77,7 +77,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
         // Hook for manipulating cacheActions
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] as $cacheAction) {
-                $hookObject = GeneralUtility::getUserObj($cacheAction);
+                $hookObject = GeneralUtility::makeInstance($cacheAction);
                 if (!$hookObject instanceof ClearCacheActionsHookInterface) {
                     throw new \UnexpectedValueException($cacheAction . ' must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
                 }
index 038a8d7..d8f62f5 100644 (file)
@@ -212,9 +212,9 @@ class ElementInformationController
         // render type by user func
         $typeRendered = false;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'] as $classRef) {
-                $typeRenderObj = GeneralUtility::getUserObj($classRef);
-                if (is_object($typeRenderObj) && method_exists($typeRenderObj, 'isValid') && method_exists($typeRenderObj, 'render')) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'] as $className) {
+                $typeRenderObj = GeneralUtility::makeInstance($className);
+                if (method_exists($typeRenderObj, 'isValid') && method_exists($typeRenderObj, 'render')) {
                     if ($typeRenderObj->isValid($this->type, $this)) {
                         $content .= $typeRenderObj->render($this->type, $this);
                         $typeRendered = true;
index 68d4019..2552f53 100644 (file)
@@ -225,11 +225,11 @@ class NewContentElementController extends AbstractModule
             // Wrapper for wizards
             // Hook for manipulating wizardItems, wrapper, onClickEvent etc.
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $classData) {
-                    $hookObject = GeneralUtility::getUserObj($classData);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof NewContentElementWizardHookInterface) {
                         throw new \UnexpectedValueException(
-                            $classData . ' must implement interface ' . NewContentElementWizardHookInterface::class,
+                            $className . ' must implement interface ' . NewContentElementWizardHookInterface::class,
                             1227834741
                         );
                     }
index 97c2894..453b779 100644 (file)
@@ -594,10 +594,10 @@ class InlineRecordContainer extends AbstractContainer
         if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'])) {
             $tceformsInlineHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'];
             if (is_array($tceformsInlineHook)) {
-                foreach ($tceformsInlineHook as $classData) {
-                    $processObject = GeneralUtility::getUserObj($classData);
+                foreach ($tceformsInlineHook as $className) {
+                    $processObject = GeneralUtility::makeInstance($className);
                     if (!$processObject instanceof InlineElementHookInterface) {
-                        throw new \UnexpectedValueException($classData . ' must implement interface ' . InlineElementHookInterface::class, 1202072000);
+                        throw new \UnexpectedValueException($className . ' must implement interface ' . InlineElementHookInterface::class, 1202072000);
                     }
                     $this->hookObjects[] = $processObject;
                 }
index 1b7c0c0..7c96f2a 100644 (file)
@@ -131,7 +131,7 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication
                     }
                     $controllerClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController'][$controllerKey];
                     if ($controllerClass) {
-                        $this->frontendEdit = GeneralUtility::getUserObj($controllerClass);
+                        $this->frontendEdit = GeneralUtility::makeInstance($controllerClass);
                     }
                     break;
                 }
index a8554c7..21d7185 100644 (file)
@@ -80,9 +80,9 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
         $this->hiddenRecords = GeneralUtility::trimExplode(',', $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages'));
         $hookElements = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'];
         if (is_array($hookElements)) {
-            foreach ($hookElements as $classRef) {
+            foreach ($hookElements as $className) {
                 /** @var $hookObject \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface */
-                $hookObject = GeneralUtility::getUserObj($classRef);
+                $hookObject = GeneralUtility::makeInstance($className);
                 if ($hookObject instanceof \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface) {
                     $this->processCollectionHookObjects[] = $hookObject;
                 }
index f609471..274fe84 100644 (file)
@@ -2517,8 +2517,8 @@ class BackendUtility
             isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
             && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
         ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] as $funcRef) {
-                $hookObj = GeneralUtility::getUserObj($funcRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObj, 'preProcess')) {
                     $hookObj->preProcess(
                         $pageUid,
@@ -3551,12 +3551,9 @@ class BackendUtility
             // Now, try to create parser object:
             $objRef = null;
             if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey])) {
-                $objRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey];
-                if ($objRef) {
-                    $softRefParserObj = GeneralUtility::getUserObj($objRef);
-                    if (is_object($softRefParserObj)) {
-                        $GLOBALS['T3_VAR']['softRefParser'][$spKey] = $softRefParserObj;
-                    }
+                $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey];
+                if ($className) {
+                    $GLOBALS['T3_VAR']['softRefParser'][$spKey] = GeneralUtility::makeInstance($className);
                 }
             }
         }
index c23f40e..0b2df0d 100644 (file)
@@ -1459,10 +1459,10 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             // Call drawFooter hooks
         $drawFooterHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawFooter'];
         if (is_array($drawFooterHooks)) {
-            foreach ($drawFooterHooks as $hookClass) {
-                $hookObject = GeneralUtility::getUserObj($hookClass);
+            foreach ($drawFooterHooks as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof PageLayoutViewDrawFooterHookInterface) {
-                    throw new \UnexpectedValueException($hookClass . ' must implement interface ' . PageLayoutViewDrawFooterHookInterface::class, 1404378171);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawFooterHookInterface::class, 1404378171);
                 }
                 $hookObject->preProcess($this, $info, $row);
             }
@@ -1668,10 +1668,10 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         // Hook: Render an own preview of a record
         $drawItemHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'];
         if (is_array($drawItemHooks)) {
-            foreach ($drawItemHooks as $hookClass) {
-                $hookObject = GeneralUtility::getUserObj($hookClass);
+            foreach ($drawItemHooks as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof PageLayoutViewDrawItemHookInterface) {
-                    throw new \UnexpectedValueException($hookClass . ' must implement interface ' . PageLayoutViewDrawItemHookInterface::class, 1218547409);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawItemHookInterface::class, 1218547409);
                 }
                 $hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);
             }
index d0e5ee6..cfa2e4a 100644 (file)
@@ -1452,8 +1452,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         );
         // Hook for manipulation of the WHERE sql sentence which controls which BE-groups are included
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObj, 'fetchGroupQuery_processQuery')) {
                     $constraints = $hookObj->fetchGroupQuery_processQuery($this, $grList, $idList, (string)$constraints);
                 }
index b8b5a78..ab6dc3d 100644 (file)
@@ -78,10 +78,10 @@ class FileDumpController
 
             // Hook: allow some other process to do some security/access checks. Hook should issue 403 if access is rejected
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'] as $classRef) {
-                    $hookObject = GeneralUtility::getUserObj($classRef);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof FileDumpEIDHookInterface) {
-                        throw new \UnexpectedValueException($classRef . ' must implement interface ' . FileDumpEIDHookInterface::class, 1394442417);
+                        throw new \UnexpectedValueException($className . ' must implement interface ' . FileDumpEIDHookInterface::class, 1394442417);
                     }
                     $hookObject->checkFileAccess($file);
                 }
index ef952e3..f2f7180 100644 (file)
@@ -869,12 +869,12 @@ class Bootstrap
     protected function runExtTablesPostProcessingHooks()
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'] as $classReference) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'] as $className) {
                 /** @var $hookObject \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface */
-                $hookObject = GeneralUtility::getUserObj($classReference);
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface) {
                     throw new \UnexpectedValueException(
-                        '$hookObject "' . $classReference . '" must implement interface TYPO3\\CMS\\Core\\Database\\TableConfigurationPostProcessingHookInterface',
+                        '$hookObject "' . $className . '" must implement interface TYPO3\\CMS\\Core\\Database\\TableConfigurationPostProcessingHookInterface',
                         1320585902
                     );
                 }
index 18bf76c..4d7bab1 100644 (file)
@@ -906,10 +906,10 @@ class DataHandler
         if (!isset($this->checkModifyAccessListHookObjects)) {
             $this->checkModifyAccessListHookObjects = [];
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'] as $classData) {
-                    $hookObject = GeneralUtility::getUserObj($classData);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof DataHandlerCheckModifyAccessListHookInterface) {
-                        throw new \UnexpectedValueException($classData . ' must implement interface ' . DataHandlerCheckModifyAccessListHookInterface::class, 1251892472);
+                        throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerCheckModifyAccessListHookInterface::class, 1251892472);
                     }
                     $this->checkModifyAccessListHookObjects[] = $hookObject;
                 }
@@ -947,8 +947,8 @@ class DataHandler
         // First prepare user defined objects (if any) for hooks which extend this function:
         $hookObjectsArr = [];
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObject, 'processDatamap_beforeStart')) {
                     $hookObject->processDatamap_beforeStart($this);
                 }
@@ -2160,10 +2160,10 @@ class DataHandler
                                         GeneralUtility::upload_copy_move($theFile, $theDestFile);
                                         // Hook for post-processing the upload action
                                         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'])) {
-                                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'] as $classRef) {
-                                                $hookObject = GeneralUtility::getUserObj($classRef);
+                                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'] as $className) {
+                                                $hookObject = GeneralUtility::makeInstance($className);
                                                 if (!$hookObject instanceof DataHandlerProcessUploadHookInterface) {
-                                                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . DataHandlerProcessUploadHookInterface::class, 1279962349);
+                                                    throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerProcessUploadHookInterface::class, 1279962349);
                                                 }
                                                 $hookObject->processUpload_postProcessAction($theDestFile, $this);
                                             }
@@ -2351,8 +2351,8 @@ class DataHandler
             $arrValue = GeneralUtility::xml2array($xmlValue);
 
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'] as $classRef) {
-                    $hookObject = GeneralUtility::getUserObj($classRef);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (method_exists($hookObject, 'checkFlexFormValue_beforeMerge')) {
                         $hookObject->checkFlexFormValue_beforeMerge($this, $currentValueArray, $arrValue);
                     }
@@ -3140,8 +3140,8 @@ class DataHandler
         // Hook initialization:
         $hookObjectsArr = [];
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObj, 'processCmdmap_beforeStart')) {
                     $hookObj->processCmdmap_beforeStart($this);
                 }
@@ -4289,8 +4289,8 @@ class DataHandler
         $recordWasMoved = false;
         // Move the record via a hook, used e.g. for versioning
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObj, 'moveRecord')) {
                     $hookObj->moveRecord($table, $uid, $destPid, $propArr, $moveRec, $resolvedPid, $recordWasMoved, $this);
                 }
@@ -4328,8 +4328,8 @@ class DataHandler
         // Prepare user defined objects (if any) for hooks which extend this function:
         $hookObjectsArr = [];
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $classRef) {
-                $hookObjectsArr[] = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $className) {
+                $hookObjectsArr[] = GeneralUtility::makeInstance($className);
             }
         }
         // Timestamp field:
@@ -4729,8 +4729,8 @@ class DataHandler
                         $translateToMsg = @sprintf($TSConfig['translateToMessage'], $langRec['title']);
                     }
                     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'] as $classRef) {
-                            $hookObj = GeneralUtility::getUserObj($classRef);
+                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'] as $className) {
+                            $hookObj = GeneralUtility::makeInstance($className);
                             if (method_exists($hookObj, 'processTranslateTo_copyAction')) {
                                 $hookObj->processTranslateTo_copyAction($row[$fN], $langRec, $this);
                             }
@@ -4950,8 +4950,8 @@ class DataHandler
         if (is_array($recordToDelete)) {
             $recordWasDeleted = false;
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $classRef) {
-                    $hookObj = GeneralUtility::getUserObj($classRef);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $className) {
+                    $hookObj = GeneralUtility::makeInstance($className);
                     if (method_exists($hookObj, 'processCmdmap_deleteAction')) {
                         $hookObj->processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted, $this);
                     }
index 14c481a..b3babf0 100644 (file)
@@ -113,7 +113,7 @@ class ExtDirectApi
                 }
                 if (is_array($configuration)) {
                     $className = $configuration['callbackClass'];
-                    $serverObject = GeneralUtility::getUserObj($className);
+                    $serverObject = GeneralUtility::makeInstance($className);
                     $javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName] = [];
                     foreach (get_class_methods($serverObject) as $methodName) {
                         $reflectionMethod = new \ReflectionMethod($serverObject, $methodName);
index e981d89..b4a49f3 100644 (file)
@@ -136,7 +136,7 @@ class ExtDirectRouter
                 'access' => $configuration['accessLevel']
             ], true);
         }
-        $endpointObject = GeneralUtility::getUserObj($callbackClass);
+        $endpointObject = GeneralUtility::makeInstance($callbackClass);
         return call_user_func_array([$endpointObject, $singleRequest->method], is_array($singleRequest->data) ? $singleRequest->data : []);
     }
 }
index c099398..c8653bf 100644 (file)
@@ -96,11 +96,9 @@ class FrontendEditingController
         if ($GLOBALS['TSFE']->displayEditIcons && $table && $this->allowedToEdit($table, $dataArray, $conf, $checkEditAccessInternals) && $this->allowedToEditLanguage($table, $dataArray)) {
             $editClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/classes/class.frontendedit.php']['edit'];
             if ($editClass) {
-                $edit = GeneralUtility::getUserObj($editClass);
-                if (is_object($edit)) {
-                    $allowedActions = $this->getAllowedEditActions($table, $conf, $dataArray['pid']);
-                    $content = $edit->editPanel($content, $conf, $currentRecord, $dataArray, $table, $allowedActions, $newUid, $this->getHiddenFields($dataArray));
-                }
+                $edit = GeneralUtility::makeInstance($editClass);
+                $allowedActions = $this->getAllowedEditActions($table, $conf, $dataArray['pid']);
+                $content = $edit->editPanel($content, $conf, $currentRecord, $dataArray, $table, $allowedActions, $newUid, $this->getHiddenFields($dataArray));
             }
         }
         return $content;
@@ -138,10 +136,8 @@ class FrontendEditingController
         if ($GLOBALS['TSFE']->displayFieldEditIcons && $table && $this->allowedToEdit($table, $dataArray, $conf) && $fieldList && $this->allowedToEditLanguage($table, $dataArray)) {
             $editClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/classes/class.frontendedit.php']['edit'];
             if ($editClass) {
-                $edit = GeneralUtility::getUserObj($editClass);
-                if (is_object($edit)) {
-                    $content = $edit->editIcons($content, $params, $conf, $currentRecord, $dataArray, $addUrlParamStr, $table, $editUid, $fieldList);
-                }
+                $edit = GeneralUtility::makeInstance($editClass);
+                $content = $edit->editIcons($content, $params, $conf, $currentRecord, $dataArray, $addUrlParamStr, $table, $editUid, $fieldList);
             }
         }
         return $content;
index 88ecc07..200eb53 100644 (file)
@@ -206,8 +206,8 @@ class RteHtmlParser extends HtmlParser
         foreach ($modes as $cmd) {
             if ($direction === 'db') {
                 // Checking for user defined transformation:
-                if ($_classRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][$cmd]) {
-                    $_procObj = GeneralUtility::getUserObj($_classRef);
+                if ($className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][$cmd]) {
+                    $_procObj = GeneralUtility::makeInstance($className);
                     $_procObj->pObj = $this;
                     $_procObj->transformationKey = $cmd;
                     $value = $_procObj->transform_db($value, $this);
@@ -236,8 +236,8 @@ class RteHtmlParser extends HtmlParser
                 }
             } elseif ($direction === 'rte') {
                 // Checking for user defined transformation:
-                if ($_classRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][$cmd]) {
-                    $_procObj = GeneralUtility::getUserObj($_classRef);
+                if ($className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][$cmd]) {
+                    $_procObj = GeneralUtility::makeInstance($className);
                     $_procObj->pObj = $this;
                     $value = $_procObj->transform_rte($value, $this);
                 } else {
@@ -548,8 +548,8 @@ class RteHtmlParser extends HtmlParser
                         'url' => $linkInformation['href'],
                         'attributes' => $tagAttributes
                     ];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'] as $objRef) {
-                        $processor = GeneralUtility::getUserObj($objRef);
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'] as $className) {
+                        $processor = GeneralUtility::makeInstance($className);
                         $blockSplit[$k] = $processor->modifyParamsLinksDb($parameters, $this);
                     }
                 } else {
@@ -613,8 +613,8 @@ class RteHtmlParser extends HtmlParser
                         'external' => $linkInformation['type'] === LinkService::TYPE_URL,
                         'error' => $error
                     ];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'] as $objRef) {
-                        $processor = GeneralUtility::getUserObj($objRef);
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'] as $className) {
+                        $processor = GeneralUtility::makeInstance($className);
                         $blockSplit[$k] = $processor->modifyParamsLinksRte($parameters, $this);
                     }
                 } else {
index 98a870a..37dfe90 100644 (file)
@@ -328,8 +328,8 @@ class IconFactory
         // Hook to define an alternative iconName
         if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['overrideIconOverlay'])) {
             $hookObjects = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['overrideIconOverlay'];
-            foreach ($hookObjects as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($hookObjects as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObject, 'postOverlayPriorityLookup')) {
                     $iconName = $hookObject->postOverlayPriorityLookup($table, $row, $status, $iconName);
                 }
index de6c4e1..8d7f9f6 100644 (file)
@@ -268,10 +268,10 @@ class ExtendedFileUtility extends BasicFileUtility
                         }
                         // Hook for post-processing the action
                         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'])) {
-                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'] as $classRef) {
-                                $hookObject = GeneralUtility::getUserObj($classRef);
+                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'] as $className) {
+                                $hookObject = GeneralUtility::makeInstance($className);
                                 if (!$hookObject instanceof ExtendedFileUtilityProcessDataHookInterface) {
-                                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . ExtendedFileUtilityProcessDataHookInterface::class, 1279719168);
+                                    throw new \UnexpectedValueException($className . ' must implement interface ' . ExtendedFileUtilityProcessDataHookInterface::class, 1279719168);
                                 }
                                 $hookObject->processData_postProcessAction($action, $cmdArr, $result[$action], $this);
                             }
index 7e0c1c9..07eb7f5 100644 (file)
@@ -3369,7 +3369,7 @@ class GeneralUtility
      * @param string $_ Not used anymore since 6.0
      * @param int $errorMode Error mode (when class/function could not be found): 0 - call debug(), 1 - do nothing, 2 - raise an exception (allows to call a user function that may return FALSE)
      * @return mixed Content from method/function call or FALSE if the class/method/function was not found
-     * @see getUserObj()
+     * @see makeInstance()
      */
     public static function callUserFunction($funcName, &$params, &$ref, $_ = '', $errorMode = 0)
     {
@@ -3432,9 +3432,11 @@ class GeneralUtility
      * @param string $className Class name
      * @return object The instance of the class asked for. Instance is created with GeneralUtility::makeInstance
      * @see callUserFunction()
+     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10, use makeInstance instead.
      */
     public static function getUserObj($className)
     {
+        self::logDeprecatedFunction();
         // Check if class exists:
         if (class_exists($className)) {
             return self::makeInstance($className);
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80993-GeneralUtilitygetUserObj.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80993-GeneralUtilitygetUserObj.rst
new file mode 100644 (file)
index 0000000..22d4771
--- /dev/null
@@ -0,0 +1,33 @@
+.. include:: ../../Includes.txt
+
+================================================
+Deprecation: #80993 - GeneralUtility::getUserObj
+================================================
+
+See :issue:`80993`
+
+Description
+===========
+
+The method php:`GeneralUtility::getUserObj()` has been marked as deprecated as it is a sole wrapper for
+php:`GeneralUtility::makeInstance()`.
+
+
+Impact
+======
+
+Calling the method will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Any installation using third-party extension that call this method.
+
+
+Migration
+=========
+
+Use php:`GeneralUtility::makeInstance()` instead, which acts as a simple drop-in replacement.
+
+.. index:: PHP-API
\ No newline at end of file
index cb7eb9b..7232e15 100644 (file)
@@ -1025,11 +1025,11 @@ class FileList extends AbstractRecordList
         // Hook for manipulating edit icons.
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'])) {
             $cells['__fileOrFolderObject'] = $fileOrFolderObject;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof FileListEditIconHookInterface) {
                     throw new \UnexpectedValueException(
-                        $classData . ' must implement interface ' . FileListEditIconHookInterface::class,
+                        $className . ' must implement interface ' . FileListEditIconHookInterface::class,
                         1235225797
                     );
                 }
index cf962e4..ca9c1c6 100644 (file)
@@ -82,8 +82,8 @@ class ContentContentObject extends AbstractContentObject
                 foreach ($records as $row) {
                     // Call hook for possible manipulation of database row for cObj->data
                     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'] as $_classRef) {
-                            $_procObj = GeneralUtility::getUserObj($_classRef);
+                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'] as $className) {
+                            $_procObj = GeneralUtility::makeInstance($className);
                             $_procObj->modifyDBRow($row, $conf['table']);
                         }
                     }
index 225ee7b..ca29987 100644 (file)
@@ -558,19 +558,19 @@ class ContentObjectRenderer
         }
         $this->stdWrapHookObjects = [];
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof ContentObjectStdWrapHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . ContentObjectStdWrapHookInterface::class, 1195043965);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectStdWrapHookInterface::class, 1195043965);
                 }
                 $this->stdWrapHookObjects[] = $hookObject;
             }
         }
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'] as $classData) {
-                $postInitializationProcessor = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'] as $className) {
+                $postInitializationProcessor = GeneralUtility::makeInstance($className);
                 if (!$postInitializationProcessor instanceof ContentObjectPostInitHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . ContentObjectPostInitHookInterface::class, 1274563549);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectPostInitHookInterface::class, 1274563549);
                 }
                 $postInitializationProcessor->postProcessContentObjectInitialization($this);
             }
@@ -598,8 +598,8 @@ class ContentObjectRenderer
         if (!isset($this->getImgResourceHookObjects)) {
             $this->getImgResourceHookObjects = [];
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'] as $classData) {
-                    $hookObject = GeneralUtility::getUserObj($classData);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof ContentObjectGetImageResourceHookInterface) {
                         throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetImageResourceHookInterface::class, 1218636383);
                     }
@@ -718,7 +718,7 @@ class ContentObjectRenderer
                 // Application defined cObjects
                 if (!empty($this->cObjHookObjectsRegistry[$name])) {
                     if (empty($this->cObjHookObjectsArr[$name])) {
-                        $this->cObjHookObjectsArr[$name] = GeneralUtility::getUserObj($this->cObjHookObjectsRegistry[$name]);
+                        $this->cObjHookObjectsArr[$name] = GeneralUtility::makeInstance($this->cObjHookObjectsRegistry[$name]);
                     }
                     $hookObj = $this->cObjHookObjectsArr[$name];
                     if (method_exists($hookObj, 'cObjGetSingleExt')) {
@@ -733,8 +733,8 @@ class ContentObjectRenderer
                     } else {
                         // Call hook functions for extra processing
                         if ($name && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) {
-                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $classData) {
-                                $hookObject = GeneralUtility::getUserObj($classData);
+                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $className) {
+                                $hookObject = GeneralUtility::makeInstance($className);
                                 if (!$hookObject instanceof ContentObjectGetSingleHookInterface) {
                                     throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetSingleHookInterface::class, 1195043731);
                                 }
@@ -1222,8 +1222,8 @@ class ContentObjectRenderer
                     $oneSourceCollection = $this->templateService->substituteMarkerArray($sourceLayout, $sourceConfiguration, '###|###', true, true);
 
                     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'] as $classData) {
-                            $hookObject = GeneralUtility::getUserObj($classData);
+                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'] as $className) {
+                            $hookObject = GeneralUtility::makeInstance($className);
                             if (!$hookObject instanceof ContentObjectOneSourceCollectionHookInterface) {
                                 throw new \UnexpectedValueException(
                                     '$hookObject must implement interface ' . ContentObjectOneSourceCollectionHookInterface::class,
@@ -1459,8 +1459,8 @@ class ContentObjectRenderer
                 'conf' => &$conf,
                 'aTagParams' => &$aTagParams
             ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc'] as $objRef) {
-                $processor =& GeneralUtility::getUserObj($objRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc'] as $className) {
+                $processor =& GeneralUtility::makeInstance($className);
                 $aTagParams = $processor->process($_params, $this);
             }
         }
@@ -1485,7 +1485,7 @@ class ContentObjectRenderer
     {
         $out = '';
         if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['extLinkATagParamsHandler']) {
-            $extLinkATagParamsHandler = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['extLinkATagParamsHandler']);
+            $extLinkATagParamsHandler = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['extLinkATagParamsHandler']);
             if (method_exists($extLinkATagParamsHandler, 'main')) {
                 $out .= trim($extLinkATagParamsHandler->main($URL, $TYPE, $this));
             }
@@ -4993,8 +4993,8 @@ class ContentObjectRenderer
                 }
             }
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] as $classData) {
-                    $hookObject = GeneralUtility::getUserObj($classData);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof ContentObjectGetDataHookInterface) {
                         throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetDataHookInterface::class, 1195044480);
                     }
@@ -5218,7 +5218,7 @@ class ContentObjectRenderer
         // Check for link-handler keyword
         list($linkHandlerKeyword, $linkHandlerValue) = explode(':', $linkParameterParts['url'], 2);
         if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword] && (string)$linkHandlerValue !== '') {
-            $linkHandlerObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword]);
+            $linkHandlerObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword]);
             if (method_exists($linkHandlerObj, 'main')) {
                 return $linkHandlerObj->main($linkText, $configuration, $linkHandlerKeyword, $linkHandlerValue, $mixedLinkParameter, $this);
             }
index cbd8626..448a113 100644 (file)
@@ -1240,10 +1240,10 @@ abstract class AbstractMenuContentObject
     {
         $includePage = true;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof AbstractMenuFilterPagesHookInterface) {
-                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . AbstractMenuFilterPagesHookInterface::class, 1269877402);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . AbstractMenuFilterPagesHookInterface::class, 1269877402);
                 }
                 $includePage = $includePage && $hookObject->processFilter($data, $banUidArray, $spacer, $this);
             }
index 15112cc..c56ba6a 100644 (file)
@@ -2671,8 +2671,8 @@ class TypoScriptFrontendController
     {
         // Hook for processing data submission to extensions
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] as $_classRef) {
-                $_procObj = GeneralUtility::getUserObj($_classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] as $className) {
+                $_procObj = GeneralUtility::makeInstance($className);
                 $_procObj->checkDataSubmission($this);
             }
         }
@@ -2922,8 +2922,8 @@ class TypoScriptFrontendController
         // NOTE: as hooks are called in a loop, the last hook will have the final word (however each
         // hook receives the current status of the $usePageCache flag)
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] as $_classRef) {
-                $_procObj = GeneralUtility::getUserObj($_classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] as $className) {
+                $_procObj = GeneralUtility::makeInstance($className);
                 $usePageCache = $_procObj->usePageCache($this, $usePageCache);
             }
         }
@@ -2933,8 +2933,8 @@ class TypoScriptFrontendController
         }
         // Hook for cache post processing (eg. writing static files!)
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] as $_classRef) {
-                $_procObj = GeneralUtility::getUserObj($_classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] as $className) {
+                $_procObj = GeneralUtility::makeInstance($className);
                 $_procObj->insertPageIncache($this, $timeOutTime);
             }
         }
@@ -3237,8 +3237,8 @@ class TypoScriptFrontendController
         $this->content = $this->convOutputCharset($this->content);
         // Hook for indexing pages
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] as $_classRef) {
-                $_procObj = GeneralUtility::getUserObj($_classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] as $className) {
+                $_procObj = GeneralUtility::makeInstance($className);
                 $_procObj->hook_indexContent($this);
             }
         }
index 85a8b91..cd45d4e 100644 (file)
@@ -30,8 +30,8 @@ class MediaItemHooks implements \TYPO3\CMS\Core\SingletonInterface
     public function customMediaRenderTypes(&$params, $conf)
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 $hookObj->customMediaRenderTypes($params, $conf);
             }
         }
@@ -46,8 +46,8 @@ class MediaItemHooks implements \TYPO3\CMS\Core\SingletonInterface
     public function customMediaParams(&$params, $conf)
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] as $classRef) {
-                $hookObj = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
                 $hookObj->customMediaParams($params, $conf);
             }
         }
index 9929b2a..748297b 100644 (file)
@@ -233,10 +233,10 @@ class PageRepository
     {
         // Hook to manipulate the page uid for special overlay handling
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof PageRepositoryGetPageHookInterface) {
-                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . PageRepositoryGetPageHookInterface::class, 1251476766);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageHookInterface::class, 1251476766);
                 }
                 $hookObject->getPage_preProcess($uid, $disableGroupAccessCheck, $this);
             }
@@ -422,10 +422,10 @@ class PageRepository
         $row = null;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'])) {
             foreach ($pagesInput as &$origPage) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $classRef) {
-                    $hookObject = GeneralUtility::getUserObj($classRef);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $className) {
+                    $hookObject = GeneralUtility::makeInstance($className);
                     if (!$hookObject instanceof PageRepositoryGetPageOverlayHookInterface) {
-                        throw new \UnexpectedValueException($classRef . ' must implement interface ' . PageRepositoryGetPageOverlayHookInterface::class, 1269878881);
+                        throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageOverlayHookInterface::class, 1269878881);
                     }
                     $hookObject->getPageOverlay_preProcess($origPage, $lUid, $this);
                 }
@@ -521,10 +521,10 @@ class PageRepository
     public function getRecordOverlay($table, $row, $sys_language_content, $OLmode = '')
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
-                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881658);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881658);
                 }
                 $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
             }
@@ -604,10 +604,10 @@ class PageRepository
             }
         }
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
-                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881659);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881659);
                 }
                 $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
             }
index e9add21..ceacb5d 100644 (file)
@@ -290,10 +290,10 @@ class AdminPanelView
         $moduleContent .= $this->getModule('info', $this->getInfoModule());
 
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof AdminPanelViewHookInterface) {
-                    throw new \UnexpectedValueException($classRef . ' must implement interface ' . AdminPanelViewHookInterface::class, 1311942539);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . AdminPanelViewHookInterface::class, 1311942539);
                 }
                 $content = $hookObject->extendAdminPanel($moduleContent, $this);
                 if ($content) {
index 1904900..fa11bd4 100644 (file)
@@ -493,9 +493,9 @@ class AdministrationController extends ActionController
     public function statisticAction($depth = 1, $mode = 'overview')
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
                 /** @var \TYPO3\CMS\IndexedSearch\FileContentParser $fileContentParser */
-                $fileContentParser = GeneralUtility::getUserObj($_objRef);
+                $fileContentParser = GeneralUtility::makeInstance($className);
                 if ($fileContentParser->softInit($extension)) {
                     $this->external_parsers[$extension] = $fileContentParser;
                 }
index 50b6ddc..0301b23 100644 (file)
@@ -907,8 +907,8 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     {
         $newSearchWords = [];
         // Init lexer (used to post-processing of search words)
-        $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
-        $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
+        $lexerObjectClassName = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
+        $this->lexerObj = GeneralUtility::makeInstance($lexerObjectClassName);
         // Traverse the search word array
         foreach ($searchWords as $wordDef) {
             // No space in word (otherwise it might be a sentense in quotes like "there is").
@@ -1456,8 +1456,8 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     {
         // Initialize external document parsers for icon display and other soft operations
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) {
-                $this->externalParsers[$extension] = GeneralUtility::getUserObj($_objRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
+                $this->externalParsers[$extension] = GeneralUtility::makeInstance($className);
                 // Init parser and if it returns FALSE, unset its entry again
                 if (!$this->externalParsers[$extension]->softInit($extension)) {
                     unset($this->externalParsers[$extension]);
@@ -1476,7 +1476,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     {
         // Hook: menuConfig_preProcessModMenu
         if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]) {
-            $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
+            $hookObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
             if (method_exists($hookObj, $functionName)) {
                 $hookObj->pObj = $this;
                 return $hookObj;
index d28289a..154ba8f 100644 (file)
@@ -1301,7 +1301,7 @@ class IndexSearchRepository
     {
         // Hook: menuConfig_preProcessModMenu
         if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]) {
-            $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
+            $hookObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks'][$functionName]);
             if (method_exists($hookObj, $functionName)) {
                 $hookObj->pObj = $this;
                 return $hookObj;
index 05bc796..1e57f44 100644 (file)
@@ -161,18 +161,16 @@ class CrawlerHook
                     break;
                 default:
                     if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]) {
-                        $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]);
-                        if (is_object($hookObj)) {
-                            // Parameters:
-                            $params = [
-                                'indexConfigUid' => $cfgRec['uid'],
-                                // General
-                                'procInstructions' => ['[Index Cfg UID#' . $cfgRec['uid'] . '/CUSTOM]'],
-                                // General
-                                'url' => $hookObj->initMessage($message)
-                            ];
-                            $pObj->addQueueEntry_callBack($setId, $params, $this->callBack, $cfgRec['pid']);
-                        }
+                        $hookObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]);
+                        // Parameters:
+                        $params = [
+                            'indexConfigUid' => $cfgRec['uid'],
+                            // General
+                            'procInstructions' => ['[Index Cfg UID#' . $cfgRec['uid'] . '/CUSTOM]'],
+                            // General
+                            'url' => $hookObj->initMessage($message)
+                        ];
+                        $pObj->addQueueEntry_callBack($setId, $params, $this->callBack, $cfgRec['pid']);
                     }
             }
         }
@@ -233,12 +231,10 @@ class CrawlerHook
                         break;
                     default:
                         if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]) {
-                            $hookObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]);
-                            if (is_object($hookObj)) {
-                                $this->pObj = $pObj;
-                                // For addQueueEntryForHook()
-                                $hookObj->indexOperation($cfgRec, $session_data, $params, $this);
-                            }
+                            $hookObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]);
+                            $this->pObj = $pObj;
+                            // For addQueueEntryForHook()
+                            $hookObj->indexOperation($cfgRec, $session_data, $params, $this);
                         }
                 }
                 // Save process data which might be modified:
index 109a3fd..2aab8a8 100644 (file)
@@ -483,13 +483,13 @@ class Indexer
             $this->initializeExternalParsers();
         }
         // Initialize lexer (class that deconstructs the text into words):
-        $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ? $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] : 'TYPO3\\CMS\\IndexedSearch\\Lexer';
-        $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
+        $lexerObjectClassName = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: Lexer::class;
+        $this->lexerObj = GeneralUtility::makeInstance($lexerObjectClassName);
         $this->lexerObj->debug = $this->indexerConfig['debugMode'];
         // Initialize metaphone hook:
         // Make sure that the hook is loaded _after_ indexed_search as this may overwrite the hook depending on the configuration.
         if ($this->enableMetaphoneSearch && $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone']) {
-            $this->metaphoneObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone']);
+            $this->metaphoneObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone']);
             $this->metaphoneObj->pObj = $this;
         }
         // Init charset class:
@@ -505,8 +505,8 @@ class Indexer
     public function initializeExternalParsers()
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) {
-                $this->external_parsers[$extension] = GeneralUtility::getUserObj($_objRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
+                $this->external_parsers[$extension] = GeneralUtility::makeInstance($className);
                 $this->external_parsers[$extension]->pObj = $this;
                 // Init parser and if it returns FALSE, unset its entry again:
                 if (!$this->external_parsers[$extension]->initParser($extension)) {
index f8745a1..189ed1c 100644 (file)
@@ -107,8 +107,8 @@ class LinkAnalyzer
         $this->getLanguageService()->includeLLFile('EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf');
         // Hook to handle own checks
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $classRef) {
-                $this->hookObjectsArr[$key] = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $className) {
+                $this->hookObjectsArr[$key] = GeneralUtility::makeInstance($className);
             }
         }
     }
index c99d61b..7acc823 100644 (file)
@@ -238,8 +238,8 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
     protected function initialize()
     {
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
-                $this->hookObjectsArr[$linkType] = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $className) {
+                $this->hookObjectsArr[$linkType] = GeneralUtility::makeInstance($className);
             }
         }
 
index 243cc1b..2a69adc 100644 (file)
@@ -103,9 +103,9 @@ class ElementBrowserController
         // Render type by user func
         $browserRendered = false;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
-                $browserRenderObj = GeneralUtility::getUserObj($classRef);
-                if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $className) {
+                $browserRenderObj = GeneralUtility::makeInstance($className);
+                if (method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
                     if ($browserRenderObj->isValid($this->mode, $this)) {
                         $content = $browserRenderObj->render($this->mode, $this);
                         $browserRendered = true;
index 1fa443c..0fa92b0 100644 (file)
@@ -770,8 +770,8 @@ class AbstractDatabaseRecordList extends AbstractRecordList
 
         $hookName = DatabaseRecordList::class;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObject, 'buildQueryParametersPostProcess')) {
                     $hookObject->buildQueryParametersPostProcess(
                         $parameters,
index 9e83ce8..4e2590b 100644 (file)
@@ -628,10 +628,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
         $selFieldList = implode(',', $selectFields);
         $this->selFieldList = $selFieldList;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof RecordListGetTableHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . RecordListGetTableHookInterface::class, 1195114460);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListGetTableHookInterface::class, 1195114460);
                 }
                 $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this);
             }
@@ -1164,10 +1164,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
                      *        or other "Action" functions which perform operations on the listed records.
                     */
                     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
-                            $hookObject = GeneralUtility::getUserObj($classData);
+                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
+                            $hookObject = GeneralUtility::makeInstance($className);
                             if (!$hookObject instanceof RecordListHookInterface) {
-                                throw new \UnexpectedValueException($classData . ' must implement interface ' . RecordListHookInterface::class, 1195567850);
+                                throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567850);
                             }
                             $cells = $hookObject->renderListHeaderActions($table, $currentIdList, $cells, $this);
                         }
@@ -1291,10 +1291,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
          *        table or perform special clipboard tasks like mark and copy all listed records to clipboard, etc.
          */
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof RecordListHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . RecordListHookInterface::class, 1195567855);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567855);
                 }
                 $theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
             }
@@ -1693,10 +1693,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
                     $cells[$actionKey] = $action;
                 }
             }
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof RecordListHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . RecordListHookInterface::class, 1195567840);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567840);
                 }
                 $cells = $hookObject->makeControl($table, $row, $cells, $this);
             }
@@ -1855,10 +1855,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
          *        The order of the icons is depending on the order of those array entries.
          */
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!$hookObject instanceof RecordListHookInterface) {
-                    throw new \UnexpectedValueException($classData . ' must implement interface ' . RecordListHookInterface::class, 1195567845);
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567845);
                 }
                 $cells = $hookObject->makeClip($table, $row, $cells, $this);
             }
index d95f11d..c5b79ff 100644 (file)
@@ -46,8 +46,8 @@ class SystemStatus implements StatusProviderInterface
     {
         $modules = [];
         if (is_array(${$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']})) {
-            foreach (${$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']} as $classData) {
-                $hookObject = GeneralUtility::getUserObj($classData);
+            foreach (${$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']} as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 $modules = $hookObject->setRequiredPhpModules($modules, $this);
             }
         }
index 0215ac0..a65105b 100644 (file)
@@ -60,7 +60,7 @@ class BackendFactory
         if (!self::$initialized) {
             // Backend does not exist yet. Create it.
             foreach (self::$availableBackends as $backend) {
-                $backendObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($backend);
+                $backendObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($backend);
                 // Check that it is derived from the proper base class
                 if ($backendObject instanceof AbstractBackend) {
                     /** @var $backendObject AbstractBackend */
index 12ab03e..209411b 100644 (file)
@@ -49,7 +49,7 @@ class StorageFactory
     public static function getStorage()
     {
         if (self::$storageInstance === null) {
-            self::$storageInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj(self::$preferredStorage);
+            self::$storageInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(self::$preferredStorage);
         }
         return self::$storageInstance;
     }
index 0638744..913663b 100644 (file)
@@ -96,7 +96,7 @@ class SaltFactory
             } else {
                 $classNameToUse = \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::getDefaultSaltingHashingMethod($mode);
                 $availableClasses = static::getRegisteredSaltedHashingMethods();
-                self::$instance = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($availableClasses[$classNameToUse]);
+                self::$instance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($availableClasses[$classNameToUse]);
             }
         }
         return self::$instance;
@@ -121,7 +121,7 @@ class SaltFactory
         $registeredMethods = [$defaultClassName => $defaultReference] + $registeredMethods;
         $methodFound = false;
         foreach ($registeredMethods as $method) {
-            $objectInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($method);
+            $objectInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($method);
             if ($objectInstance instanceof SaltInterface) {
                 $methodFound = $objectInstance->isValidSaltedPW($saltedHash);
                 if ($methodFound) {
@@ -142,7 +142,7 @@ class SaltFactory
     public static function setPreferredHashingMethod($resource)
     {
         self::$instance = null;
-        $objectInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($resource);
+        $objectInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($resource);
         if (is_object($objectInstance) && is_subclass_of($objectInstance, \TYPO3\CMS\Saltedpasswords\Salt\AbstractSalt::class)) {
             self::$instance = $objectInstance;
         }
index 57fdee2..472e926 100644 (file)
@@ -368,7 +368,7 @@ class ExtensionManagerConfigurationUtility
         $pField = '';
         $registeredMethods = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getRegisteredSaltedHashingMethods();
         foreach ($registeredMethods as $class => $reference) {
-            $classInstance = GeneralUtility::getUserObj($reference);
+            $classInstance = GeneralUtility::makeInstance($reference);
             if ($classInstance instanceof \TYPO3\CMS\Saltedpasswords\Salt\SaltInterface && $classInstance->isAvailable()) {
                 $sel = $this->extConf[$disposal]['saltedPWHashingMethod'] == $class ? ' selected="selected" ' : '';
                 $label = 'ext.saltedpasswords.title.' . strtolower(end(explode('\\', $class)));
index 569992b..130532c 100644 (file)
@@ -607,7 +607,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             foreach ($registeredClasses as $class => $registrationInfo) {
                 if (!empty($registrationInfo['provider'])) {
                     /** @var $providerObject \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface */
-                    $providerObject = GeneralUtility::getUserObj($registrationInfo['provider']);
+                    $providerObject = GeneralUtility::makeInstance($registrationInfo['provider']);
                     if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                         $additionalFields = $providerObject->getAdditionalFields($taskInfo, null, $this);
                         $allAdditionalFields = array_merge($allAdditionalFields, [$class => $additionalFields]);
@@ -616,7 +616,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             }
         } else {
             if (!empty($registeredClasses[$taskInfo['class']]['provider'])) {
-                $providerObject = GeneralUtility::getUserObj($registeredClasses[$taskInfo['class']]['provider']);
+                $providerObject = GeneralUtility::makeInstance($registeredClasses[$taskInfo['class']]['provider']);
                 if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                     $allAdditionalFields[$taskInfo['class']] = $providerObject->getAdditionalFields($taskInfo, $task, $this);
                 }
@@ -1250,7 +1250,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             // Save additional input values
             if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields'])) {
                 /** @var $providerObject \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface */
-                $providerObject = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
+                $providerObject = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
                 if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                     $providerObject->saveAdditionalFields($this->submittedData, $task);
                 }
@@ -1278,7 +1278,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
             // Save additional input values
             if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields'])) {
                 /** @var $providerObject \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface */
-                $providerObject = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
+                $providerObject = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
                 if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                     $providerObject->saveAdditionalFields($this->submittedData, $task);
                 }
@@ -1393,7 +1393,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         // Validate additional input fields
         if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields'])) {
             /** @var $providerObject \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface */
-            $providerObject = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
+            $providerObject = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$this->submittedData['class']]['additionalFields']);
             if ($providerObject instanceof \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface) {
                 // The validate method will return true if all went well, but that must not
                 // override previous false values => AND the returned value with the existing one
index 98d10ce..da703e1 100644 (file)
@@ -68,8 +68,8 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
         $this->taskObject = $taskObject;
         $this->getLanguageService()->includeLLFile('EXT:sys_action/Resources/Private/Language/locallang.xlf');
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'] as $classRef) {
-                $this->hookObjects[] = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'] as $className) {
+                $this->hookObjects[] = GeneralUtility::makeInstance($className);
             }
         }
     }
index 04876ad..a5207e8 100644 (file)
@@ -1668,8 +1668,8 @@ class DatabaseConnection
         $this->preProcessHookObjects = [];
         $this->postProcessHookObjects = [];
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_db.php']['queryProcessors'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_db.php']['queryProcessors'] as $classRef) {
-                $hookObject = GeneralUtility::getUserObj($classRef);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_db.php']['queryProcessors'] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (!(
                     $hookObject instanceof PreProcessQueryHookInterface
                     || $hookObject instanceof PostProcessQueryHookInterface
index 548fc08..bb854a4 100644 (file)
@@ -592,8 +592,8 @@ class DataHandlerHook
             }
             // Hook for preprocessing of the content for formmails:
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'] as $_classRef) {
-                    $_procObj =& GeneralUtility::getUserObj($_classRef);
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'] as $className) {
+                    $_procObj = GeneralUtility::makeInstance($className);
                     $markers = $_procObj->postModifyMarkers($markers, $this);
                 }
             }
index c0067df..2f146cf 100644 (file)
@@ -243,7 +243,7 @@ class RemoteServer extends AbstractHandler
         // (this may be used by custom or dynamically-defined fields)
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'] as $className) {
-                $hookObject = GeneralUtility::getUserObj($className);
+                $hookObject = GeneralUtility::makeInstance($className);
                 if (method_exists($hookObject, 'modifyDifferenceArray')) {
                     $hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $diffUtility);
                 }