[TASK] Get rid of ObjectManager in install tool
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Updates / AbstractDownloadExtensionUpdate.php
index 57c2bc5..75cd002 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Install\Updates;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility;
 use TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility;
 use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
@@ -53,11 +52,8 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
     protected function installExtension($extensionKey, &$customMessages)
     {
         $updateSuccessful = true;
-        /** @var $objectManager ObjectManager */
-        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
-
         /** @var $extensionListUtility ListUtility */
-        $extensionListUtility = $objectManager->get(ListUtility::class);
+        $extensionListUtility = GeneralUtility::makeInstance(ListUtility::class);
 
         $availableExtensions = $extensionListUtility->getAvailableExtensions();
         $availableAndInstalledExtensions = $extensionListUtility->getAvailableAndInstalledExtensions($availableExtensions);
@@ -65,7 +61,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
         // Extension is not downloaded yet.
         if (!is_array($availableAndInstalledExtensions[$extensionKey])) {
             /** @var $extensionTerUtility TerUtility */
-            $extensionTerUtility = $objectManager->get(TerUtility::class);
+            $extensionTerUtility = GeneralUtility::makeInstance(TerUtility::class);
             $extensionDetails = $this->getExtensionDetails($extensionKey);
             if (empty($extensionDetails)) {
                 $updateSuccessful = false;
@@ -83,7 +79,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
             }
 
             /** @var $extensionFileHandlingUtility FileHandlingUtility */
-            $extensionFileHandlingUtility = $objectManager->get(FileHandlingUtility::class);
+            $extensionFileHandlingUtility = GeneralUtility::makeInstance(FileHandlingUtility::class);
             $extensionFileHandlingUtility->unpackExtensionFromExtensionDataArray($t3xExtracted);
 
             // The listUtility now needs to have the regenerated list of packages
@@ -92,7 +88,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
 
         if ($updateSuccessful !== false) {
             /** @var $extensionInstallUtility InstallUtility */
-            $extensionInstallUtility = $objectManager->get(InstallUtility::class);
+            $extensionInstallUtility = GeneralUtility::makeInstance(InstallUtility::class);
             $extensionInstallUtility->install($extensionKey);
         }
         return $updateSuccessful;