[TASK] Housekeeping in Extension Manager Code 91/62391/4
authorBenni Mack <benni@typo3.org>
Sat, 23 Nov 2019 09:28:56 +0000 (10:28 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 23 Nov 2019 11:06:29 +0000 (12:06 +0100)
This patch mainly:
- Does use statements in all EM code
- Removes unused fields "sponsorlink", "sponsorlogo" and "sponsorname" of mirrors XML
- Removes unused methods in internal classes

It is time to clean up... First one is to get an overview of what is still needed.

Resolves: #89751
Releases: master
Change-Id: Ie30f05f413afc259fdef6064c363fff47483b331
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62391
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
34 files changed:
typo3/sysext/extensionmanager/Classes/Controller/AbstractController.php
typo3/sysext/extensionmanager/Classes/Controller/ActionController.php
typo3/sysext/extensionmanager/Classes/Controller/DistributionController.php
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Classes/Controller/UpdateScriptController.php
typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Dependency.php
typo3/sysext/extensionmanager/Classes/Domain/Model/DownloadQueue.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Extension.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Mirrors.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Repository.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/ExtensionRepository.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/RepositoryRepository.php
typo3/sysext/extensionmanager/Classes/Report/ExtensionStatus.php
typo3/sysext/extensionmanager/Classes/Service/ExtensionManagementService.php
typo3/sysext/extensionmanager/Classes/Task/UpdateExtensionListTask.php
typo3/sysext/extensionmanager/Classes/Utility/Connection/TerUtility.php
typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php
typo3/sysext/extensionmanager/Classes/Utility/DownloadUtility.php
typo3/sysext/extensionmanager/Classes/Utility/EmConfUtility.php
typo3/sysext/extensionmanager/Classes/Utility/ExtensionModelUtility.php
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/AbstractMirrorXmlParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPullParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPushParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/XmlParserFactory.php
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php

index 716e5ac..4565c9d 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+
 /**
  * Abstract action controller.
  * @internal This class is a specific controller implementation and is not considered part of the Public TYPO3 API.
@@ -21,7 +23,6 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
 class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 {
     const TRIGGER_RefreshModuleMenu = 'refreshModuleMenu';
-
     const TRIGGER_RefreshTopbar = 'refreshTopbar';
 
     /**
@@ -41,7 +42,7 @@ class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
      */
     protected function translate($key, $arguments = null)
     {
-        return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, 'extensionmanager', $arguments);
+        return LocalizationUtility::translate($key, 'extensionmanager', $arguments);
     }
 
     /**
@@ -52,13 +53,11 @@ class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
     protected function handleTriggerArguments()
     {
         $triggers = [];
-
         foreach ($this->triggerArguments as $triggerArgument) {
             if ($this->request->hasArgument($triggerArgument)) {
                 $triggers[$triggerArgument] = $this->request->getArgument($triggerArgument);
             }
         }
-
         $this->view->assign('triggers', $triggers);
     }
 }
index 2a5c73a..56fed8d 100644 (file)
@@ -15,7 +15,12 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  */
 
 use TYPO3\CMS\Core\Registry;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
+use TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility;
+use TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility;
+use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
 
 /**
  * Controller for handling extension related actions like
@@ -25,53 +30,53 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 class ActionController extends AbstractController
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+     * @var InstallUtility
      */
     protected $installUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+     * @var FileHandlingUtility
      */
     protected $fileHandlingUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility
+     * @var ExtensionModelUtility
      */
     protected $extensionModelUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+     * @var ExtensionManagementService
      */
     protected $managementService;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
+     * @param InstallUtility $installUtility
      */
-    public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility)
+    public function injectInstallUtility(InstallUtility $installUtility)
     {
         $this->installUtility = $installUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
+     * @param FileHandlingUtility $fileHandlingUtility
      */
-    public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility)
+    public function injectFileHandlingUtility(FileHandlingUtility $fileHandlingUtility)
     {
         $this->fileHandlingUtility = $fileHandlingUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility $extensionModelUtility
+     * @param ExtensionModelUtility $extensionModelUtility
      */
-    public function injectExtensionModelUtility(\TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility $extensionModelUtility)
+    public function injectExtensionModelUtility(ExtensionModelUtility $extensionModelUtility)
     {
         $this->extensionModelUtility = $extensionModelUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
+     * @param ExtensionManagementService $managementService
      */
-    public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService)
+    public function injectManagementService(ExtensionManagementService $managementService)
     {
         $this->managementService = $managementService;
     }
@@ -83,7 +88,7 @@ class ActionController extends AbstractController
      */
     protected function toggleExtensionInstallationStateAction($extensionKey)
     {
-        $installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
+        $installedExtensions = ExtensionManagementUtility::getLoadedExtensionListArray();
         try {
             if (in_array($extensionKey, $installedExtensions)) {
                 // uninstall
index c73ffe1..fdb7f95 100644 (file)
@@ -13,10 +13,13 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Package\PackageManager;
 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 
 /**
  * Controller for distribution related actions
@@ -25,14 +28,14 @@ use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
 class DistributionController extends AbstractModuleController
 {
     /**
-     * @var \TYPO3\CMS\Core\Package\PackageManager
+     * @var PackageManager
      */
     protected $packageManager;
 
     /**
-     * @param \TYPO3\CMS\Core\Package\PackageManager $packageManager
+     * @param PackageManager $packageManager
      */
-    public function injectPackageManager(\TYPO3\CMS\Core\Package\PackageManager $packageManager)
+    public function injectPackageManager(PackageManager $packageManager)
     {
         $this->packageManager = $packageManager;
     }
@@ -55,9 +58,9 @@ class DistributionController extends AbstractModuleController
     /**
      * Shows information about the distribution
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      */
-    public function showAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
+    public function showAction(Extension $extension)
     {
         $extensionKey = $extension->getExtensionKey();
         // Check if extension/package is installed
index 7726cad..0311a78 100644 (file)
@@ -19,6 +19,10 @@ use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\View\JsonView;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
+use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
+use TYPO3\CMS\Extensionmanager\Utility\DownloadUtility;
+use TYPO3\CMS\Fluid\View\TemplateView;
 
 /**
  * Controller for actions related to the TER download of an extension
@@ -27,27 +31,17 @@ use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 class DownloadController extends AbstractController
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
-     */
-    protected $fileHandlingUtility;
-
-    /**
-     * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+     * @var ExtensionManagementService
      */
     protected $managementService;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
-     */
-    protected $installUtility;
-
-    /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility
+     * @var DownloadUtility
      */
     protected $downloadUtility;
 
@@ -62,41 +56,25 @@ class DownloadController extends AbstractController
     protected $view;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
-     */
-    public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility)
-    {
-        $this->fileHandlingUtility = $fileHandlingUtility;
-    }
-
-    /**
-     * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
+     * @param ExtensionManagementService $managementService
      */
-    public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService)
+    public function injectManagementService(ExtensionManagementService $managementService)
     {
         $this->managementService = $managementService;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-     */
-    public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility)
-    {
-        $this->installUtility = $installUtility;
-    }
-
-    /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility
+     * @param DownloadUtility $downloadUtility
      */
-    public function injectDownloadUtility(\TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility)
+    public function injectDownloadUtility(DownloadUtility $downloadUtility)
     {
         $this->downloadUtility = $downloadUtility;
     }
@@ -106,16 +84,16 @@ class DownloadController extends AbstractController
      */
     protected function initializeInstallFromTerAction()
     {
-        $this->defaultViewObjectName = \TYPO3\CMS\Fluid\View\TemplateView::class;
+        $this->defaultViewObjectName = TemplateView::class;
     }
 
     /**
      * Check extension dependencies
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @throws \Exception
      */
-    public function checkDependenciesAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
+    public function checkDependenciesAction(Extension $extension)
     {
         $message = '';
         $title = '';
@@ -192,10 +170,10 @@ class DownloadController extends AbstractController
     /**
      * Install an extension from TER action
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @param string $downloadPath
      */
-    public function installFromTerAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $downloadPath = 'Local')
+    public function installFromTerAction(Extension $extension, $downloadPath = 'Local')
     {
         list($result, $errorMessages) = $this->installFromTer($extension, $downloadPath);
         $isAutomaticInstallationEnabled = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('extensionmanager', 'automaticInstallation');
@@ -209,10 +187,10 @@ class DownloadController extends AbstractController
     /**
      * Check extension dependencies with special dependencies
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @throws \Exception
      */
-    public function installExtensionWithoutSystemDependencyCheckAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
+    public function installExtensionWithoutSystemDependencyCheckAction(Extension $extension)
     {
         $this->managementService->setSkipDependencyCheck(true);
         $this->forward('installFromTer', null, null, ['extension' => $extension, 'downloadPath' => 'Local']);
@@ -222,9 +200,9 @@ class DownloadController extends AbstractController
      * Action for installing a distribution -
      * redirects directly to configuration after installing
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      */
-    public function installDistributionAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
+    public function installDistributionAction(Extension $extension)
     {
         if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp')) {
             $this->forward('distributions', 'List');
@@ -346,11 +324,11 @@ class DownloadController extends AbstractController
      * Install an extension from TER
      * Downloads the extension, resolves dependencies and installs it
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @param string $downloadPath
      * @return array
      */
-    protected function installFromTer(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $downloadPath = 'Local')
+    protected function installFromTer(Extension $extension, $downloadPath = 'Local')
     {
         $result = false;
         $errorMessages = [];
index 2f0f7fb..93bf495 100644 (file)
@@ -20,12 +20,16 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
 use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+use TYPO3\CMS\Extensionmanager\Utility\DependencyUtility;
 use TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility;
+use TYPO3\CMS\Extensionmanager\Utility\ListUtility;
 use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
 
 /**
@@ -35,53 +39,53 @@ use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
 class ListController extends AbstractModuleController
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+     * @var ListUtility
      */
     protected $listUtility;
 
     /**
-     * @var \TYPO3\CMS\Core\Page\PageRenderer
+     * @var PageRenderer
      */
     protected $pageRenderer;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
+     * @var DependencyUtility
      */
     protected $dependencyUtility;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
+     * @param ListUtility $listUtility
      */
-    public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility)
+    public function injectListUtility(ListUtility $listUtility)
     {
         $this->listUtility = $listUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer
+     * @param PageRenderer $pageRenderer
      */
-    public function injectPageRenderer(\TYPO3\CMS\Core\Page\PageRenderer $pageRenderer)
+    public function injectPageRenderer(PageRenderer $pageRenderer)
     {
         $this->pageRenderer = $pageRenderer;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility
+     * @param DependencyUtility $dependencyUtility
      */
-    public function injectDependencyUtility(\TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility)
+    public function injectDependencyUtility(DependencyUtility $dependencyUtility)
     {
         $this->dependencyUtility = $dependencyUtility;
     }
index 7c3141c..be91794 100644 (file)
@@ -13,8 +13,13 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Extbase\Mvc\View\JsonView;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository;
+use TYPO3\CMS\Extensionmanager\Utility\ListUtility;
+use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
 
 /**
  * Controller for actions relating to update of full extension list from TER
@@ -23,22 +28,22 @@ use TYPO3\CMS\Extbase\Mvc\View\JsonView;
 class UpdateFromTerController extends AbstractController
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
+     * @var Helper
      */
     protected $repositoryHelper;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository
+     * @var RepositoryRepository
      */
     protected $repositoryRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+     * @var ListUtility
      */
     protected $listUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
@@ -48,33 +53,33 @@ class UpdateFromTerController extends AbstractController
     protected $defaultViewObjectName = JsonView::class;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper
+     * @param Helper $repositoryHelper
      */
-    public function injectRepositoryHelper(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper)
+    public function injectRepositoryHelper(Helper $repositoryHelper)
     {
         $this->repositoryHelper = $repositoryHelper;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository
+     * @param RepositoryRepository $repositoryRepository
      */
-    public function injectRepositoryRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository)
+    public function injectRepositoryRepository(RepositoryRepository $repositoryRepository)
     {
         $this->repositoryRepository = $repositoryRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
+     * @param ListUtility $listUtility
      */
-    public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility)
+    public function injectListUtility(ListUtility $listUtility)
     {
         $this->listUtility = $listUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
@@ -96,7 +101,6 @@ class UpdateFromTerController extends AbstractController
                 $errorMessage = $e->getMessage();
             }
         }
-        /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Repository $repository */
         $repository = $this->repositoryRepository->findOneTypo3OrgRepository();
 
         $timeFormat = $this->getLanguageService()->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.lastUpdate.fullTimeFormat');
index 3e0ef14..79b2348 100644 (file)
@@ -13,10 +13,12 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
+use TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility;
 
 /**
  * Controller for configuration related actions.
@@ -47,8 +49,7 @@ class UpdateScriptController extends AbstractModuleController
      */
     public function showAction($extensionKey)
     {
-        /** @var \TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility $updateScriptUtility */
-        $updateScriptUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::class);
+        $updateScriptUtility = $this->objectManager->get(UpdateScriptUtility::class);
         $updateScriptResult = $updateScriptUtility->executeUpdateIfNeeded($extensionKey);
         $this->view
             ->assign('updateScriptResult', $updateScriptResult)
index a9ca495..4cc317f 100644 (file)
@@ -18,8 +18,12 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
 use TYPO3\CMS\Extensionmanager\Exception\DependencyConfigurationNotFoundException;
 use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
+use TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility;
+use TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility;
 
 /**
  * Controller for handling upload of a local extension file
@@ -29,22 +33,22 @@ use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
 class UploadExtensionFileController extends AbstractController
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+     * @var FileHandlingUtility
      */
     protected $fileHandlingUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
+     * @var TerUtility
      */
     protected $terUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+     * @var ExtensionManagementService
      */
     protected $managementService;
 
@@ -59,33 +63,33 @@ class UploadExtensionFileController extends AbstractController
     protected $removeFromOriginalPath = false;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
+     * @param FileHandlingUtility $fileHandlingUtility
      */
-    public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility)
+    public function injectFileHandlingUtility(FileHandlingUtility $fileHandlingUtility)
     {
         $this->fileHandlingUtility = $fileHandlingUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility
+     * @param TerUtility $terUtility
      */
-    public function injectTerUtility(\TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility)
+    public function injectTerUtility(TerUtility $terUtility)
     {
         $this->terUtility = $terUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
+     * @param ExtensionManagementService $managementService
      */
-    public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService)
+    public function injectManagementService(ExtensionManagementService $managementService)
     {
         $this->managementService = $managementService;
     }
index 3276bdf..b8bde16 100644 (file)
@@ -14,11 +14,14 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Model;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+
 /**
  * Main extension model
  * @internal This class is a specific domain model implementation and is not part of the Public TYPO3 API.
  */
-class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
+class Dependency extends AbstractEntity
 {
     /**
      * @var string
@@ -107,14 +110,14 @@ class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
 
     /**
      * @param string $type
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException if no valid dependency type was given
+     * @throws ExtensionManagerException if no valid dependency type was given
      */
     public function setType($type)
     {
         if (in_array($type, self::$dependencyTypes)) {
             $this->type = $type;
         } else {
-            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($type . ' was not a valid dependency type.', 1476122402);
+            throw new ExtensionManagerException($type . ' was not a valid dependency type.', 1476122402);
         }
     }
 
index 6917bb5..a0e5703 100644 (file)
@@ -14,13 +14,14 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Model;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
 
 /**
  * Download Queue - storage for extensions to be downloaded
  * @internal This class is a specific domain model implementation and is not part of the Public TYPO3 API.
  */
-class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
+class DownloadQueue implements SingletonInterface
 {
     /**
      * Storage for extensions to be downloaded
@@ -44,28 +45,15 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
     protected $extensionCopyStorage = [];
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
-     */
-    protected $listUtility;
-
-    /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-     */
-    public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility)
-    {
-        $this->listUtility = $listUtility;
-    }
-
-    /**
      * Adds an extension to the download queue.
      * If the extension was already requested in a different version
      * an exception is thrown.
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @param string $stack
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+     * @throws ExtensionManagerException
      */
-    public function addExtensionToQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack = 'download')
+    public function addExtensionToQueue(Extension $extension, $stack = 'download')
     {
         if (!is_string($stack) || !in_array($stack, ['download', 'update'])) {
             throw new ExtensionManagerException('Stack has to be either "download" or "update"', 1342432103);
@@ -96,11 +84,11 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
     /**
      * Remove an extension from download queue
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      * @param string $stack Stack to remove extension from (download, update or install)
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+     * @throws ExtensionManagerException
      */
-    public function removeExtensionFromQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack = 'download')
+    public function removeExtensionFromQueue(Extension $extension, $stack = 'download')
     {
         if (!is_string($stack) || !in_array($stack, ['download', 'update'])) {
             throw new ExtensionManagerException('Stack has to be either "download" or "update"', 1342432104);
@@ -123,18 +111,6 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
     }
 
     /**
-     * Removes an extension from the install queue
-     *
-     * @param string $extensionKey
-     */
-    public function removeExtensionFromInstallQueue($extensionKey)
-    {
-        if (array_key_exists($extensionKey, $this->extensionInstallStorage)) {
-            unset($this->extensionInstallStorage[$extensionKey]);
-        }
-    }
-
-    /**
      * Adds an extension to the copy queue for later copying
      *
      * @param string $extensionKey
@@ -168,16 +144,6 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
     }
 
     /**
-     * Gets the extension copy queue
-     *
-     * @return array
-     */
-    public function getExtensionCopyStorage()
-    {
-        return $this->extensionCopyStorage;
-    }
-
-    /**
      * Return whether the queue contains extensions or not
      *
      * @param string $stack
@@ -199,16 +165,6 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface
     }
 
     /**
-     * Return whether the install queue contains extensions or not
-     *
-     * @return bool
-     */
-    public function isInstallQueueEmpty()
-    {
-        return empty($this->extensionInstallStorage);
-    }
-
-    /**
      * Resets the extension queue and returns old extensions
      *
      * @param string|null $stack if null, all stacks are reset
index 6987751..01b2ac5 100644 (file)
@@ -15,12 +15,15 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Model;
  */
 
 use TYPO3\CMS\Core\Core\Environment;
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility;
 
 /**
  * Main extension model
  * @internal This class is a specific domain model implementation and is not part of the Public TYPO3 API.
  */
-class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
+class Extension extends AbstractEntity
 {
     /**
      * Category index for distributions
@@ -63,7 +66,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     ];
 
     /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+     * @var ObjectManager
      */
     protected $objectManager;
 
@@ -164,9 +167,9 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     protected $position = 0;
 
     /**
-     * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
+     * @param ObjectManager $objectManager
      */
-    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
+    public function injectObjectManager(ObjectManager $objectManager)
     {
         $this->objectManager = $objectManager;
     }
@@ -526,17 +529,16 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     public function getDependencies()
     {
         if (!is_object($this->dependencies)) {
-            /** @var \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility $extensionModelUtility */
-            $extensionModelUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility::class);
+            $extensionModelUtility = $this->objectManager->get(ExtensionModelUtility::class);
             $this->setDependencies($extensionModelUtility->convertDependenciesToObjects($this->getSerializedDependencies()));
         }
         return $this->dependencies;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+     * @param Dependency $dependency
      */
-    public function addDependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency)
+    public function addDependency(Dependency $dependency)
     {
         $this->dependencies->attach($dependency);
     }
index f97acc2..e1c832d 100644 (file)
@@ -14,11 +14,13 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Model;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+
 /**
  * Repository mirrors object for extension manager.
  * @internal This class is a specific domain model implementation and is not part of the Public TYPO3 API.
  */
-class Mirrors extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
+class Mirrors extends AbstractEntity
 {
     /**
      * Keeps mirrors.
index 2ece508..dffca69 100644 (file)
@@ -14,11 +14,14 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Model;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+
 /**
  * Repository object for extension manager.
  * @internal This class is a specific domain model implementation and is not part of the Public TYPO3 API.
  */
-class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
+class Repository extends AbstractEntity
 {
     /**
      * Keeps repository title.
@@ -44,7 +47,7 @@ class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     /**
      * Keeps repository mirrors object.
      *
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors
+     * @var Mirrors
      */
     protected $mirrors;
 
@@ -137,7 +140,7 @@ class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
      */
     public function setMirrorListUrl($url)
     {
-        if (empty($url) || !empty($url) && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($url)) {
+        if (empty($url) || GeneralUtility::isValidUrl($url)) {
             $this->mirrorListUrl = $url;
         }
     }
@@ -161,7 +164,7 @@ class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
      */
     public function setWsdlUrl($url)
     {
-        if (!empty($url) && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($url)) {
+        if (!empty($url) && GeneralUtility::isValidUrl($url)) {
             $this->wsdlUrl = $url;
         }
     }
@@ -211,12 +214,12 @@ class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
      *
      * Repository mirrors object is passed by reference.
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors $mirrors mirror list
+     * @param Mirrors $mirrors mirror list
      * @see getMirrors()
      * @see hasMirrors()
      * @see removeMirrors()
      */
-    public function addMirrors(\TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors $mirrors)
+    public function addMirrors(Mirrors $mirrors)
     {
         $this->mirrors = $mirrors;
     }
@@ -242,7 +245,7 @@ class Repository extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     /**
      * Method returns a repository mirrors object.
      *
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors mirrors for repository
+     * @return Mirrors mirrors for repository
      * @see addMirrors()
      * @see hasMirrors()
      * @see removeMirrors()
index 2f48ac4..75e4cdd 100644 (file)
@@ -18,12 +18,18 @@ use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Platform\PlatformInformation;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Persistence\Generic\Query;
+use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
+use TYPO3\CMS\Extbase\Persistence\QueryInterface;
+use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
+use TYPO3\CMS\Extbase\Persistence\Repository;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 
 /**
  * A repository for extensions
  * @internal This class is a specific domain repository implementation and is not part of the Public TYPO3 API.
  */
-class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
+class ExtensionRepository extends Repository
 {
     /**
      * @var string
@@ -35,8 +41,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      */
     public function initializeObject()
     {
-        /** @var \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $defaultQuerySettings */
-        $defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
+        $defaultQuerySettings = $this->objectManager->get(QuerySettingsInterface::class);
         $defaultQuerySettings->setRespectStoragePage(false);
         $this->setDefaultQuerySettings($defaultQuerySettings);
     }
@@ -56,7 +61,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
     /**
      * Finds all extensions
      *
-     * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return array|QueryResultInterface
      */
     public function findAll()
     {
@@ -64,7 +69,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
         $query = $this->addDefaultConstraints($query);
         $query->setOrderings(
             [
-                'lastUpdated' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
+                'lastUpdated' => QueryInterface::ORDER_DESCENDING
             ]
         );
         return $query->execute();
@@ -74,13 +79,18 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * Find an extension by extension key ordered by version
      *
      * @param string $extensionKey
-     * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return QueryResultInterface
      */
     public function findByExtensionKeyOrderedByVersion($extensionKey)
     {
         $query = $this->createQuery();
-        $query->matching($query->logicalAnd($query->equals('extensionKey', $extensionKey), $query->greaterThanOrEqual('reviewState', 0)));
-        $query->setOrderings(['integerVersion' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]);
+        $query->matching(
+            $query->logicalAnd(
+                $query->equals('extensionKey', $extensionKey),
+                $query->greaterThanOrEqual('reviewState', 0)
+            )
+        );
+        $query->setOrderings(['integerVersion' => QueryInterface::ORDER_DESCENDING]);
         return $query->execute();
     }
 
@@ -88,7 +98,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * Find the current version by extension key
      *
      * @param string $extensionKey
-     * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return array|QueryResultInterface
      */
     public function findOneByCurrentVersionByExtensionKey($extensionKey)
     {
@@ -109,7 +119,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      *
      * @param string $extensionKey
      * @param string $version (example: 4.3.10)
-     * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return array|QueryResultInterface
      */
     public function findOneByExtensionKeyAndVersion($extensionKey, $version)
     {
@@ -184,7 +194,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
             ->fetchAll();
 
         $dataMapper = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class);
-        return $dataMapper->map(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension::class, $result);
+        return $dataMapper->map(Extension::class, $result);
     }
 
     /**
@@ -194,7 +204,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * @param int $lowestVersion
      * @param int $highestVersion
      * @param bool $includeCurrentVersion
-     * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return QueryResultInterface
      */
     public function findByVersionRangeAndExtensionKeyOrderedByVersion($extensionKey, $lowestVersion = 0, $highestVersion = 0, $includeCurrentVersion = true)
     {
@@ -225,7 +235,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
             $query->matching($query->logicalAnd($constraint, $query->greaterThanOrEqual('reviewState', 0)));
         }
         $query->setOrderings([
-            'integerVersion' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
+            'integerVersion' => QueryInterface::ORDER_DESCENDING
         ]);
         return $query->execute();
     }
@@ -233,20 +243,20 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
     /**
      * Finds all extensions with category "distribution" not published by the TYPO3 CMS Team
      *
-     * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return QueryResultInterface
      */
     public function findAllCommunityDistributions()
     {
         $query = $this->createQuery();
         $query->matching(
             $query->logicalAnd(
-                $query->equals('category', \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY),
+                $query->equals('category', Extension::DISTRIBUTION_CATEGORY),
                 $query->logicalNot($query->equals('ownerusername', 'typo3v4'))
             )
         );
 
         $query->setOrderings([
-            'alldownloadcounter' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
+            'alldownloadcounter' => QueryInterface::ORDER_DESCENDING
         ]);
 
         return $query->execute();
@@ -255,20 +265,20 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
     /**
      * Finds all extensions with category "distribution" that are published by the TYPO3 CMS Team
      *
-     * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+     * @return QueryResultInterface
      */
     public function findAllOfficialDistributions()
     {
         $query = $this->createQuery();
         $query->matching(
             $query->logicalAnd(
-                $query->equals('category', \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY),
+                $query->equals('category', Extension::DISTRIBUTION_CATEGORY),
                 $query->equals('ownerusername', 'typo3v4')
             )
         );
 
         $query->setOrderings([
-            'alldownloadcounter' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
+            'alldownloadcounter' => QueryInterface::ORDER_DESCENDING
         ]);
 
         return $query->execute();
@@ -291,14 +301,14 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * Find highest version available of an extension
      *
      * @param string $extensionKey
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Extension
+     * @return Extension
      */
     public function findHighestAvailableVersion($extensionKey)
     {
         $query = $this->createQuery();
         $query->matching($query->logicalAnd($query->equals('extensionKey', $extensionKey), $query->greaterThanOrEqual('reviewState', 0)));
         $query->setOrderings([
-            'integerVersion' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
+            'integerVersion' => QueryInterface::ORDER_DESCENDING
         ]);
         return $query->setLimit(1)->execute()->getFirst();
     }
@@ -417,10 +427,10 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * Adds default constraints to the query - in this case it
      * enables us to always just search for the latest version of an extension
      *
-     * @param \TYPO3\CMS\Extbase\Persistence\Generic\Query $query the query to adjust
-     * @return \TYPO3\CMS\Extbase\Persistence\Generic\Query
+     * @param Query $query the query to adjust
+     * @return Query
      */
-    protected function addDefaultConstraints(\TYPO3\CMS\Extbase\Persistence\Generic\Query $query)
+    protected function addDefaultConstraints(Query $query): Query
     {
         if ($query->getConstraint()) {
             $query->matching($query->logicalAnd(
index eb66e36..3c98c3e 100644 (file)
@@ -14,19 +14,21 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Repository;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
+use TYPO3\CMS\Extbase\Persistence\Repository;
+
 /**
  * A repository for extension repositories
  * @internal This class is a specific domain repository implementation and is not part of the Public TYPO3 API.
  */
-class RepositoryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
+class RepositoryRepository extends Repository
 {
     /**
      * Do not include pid in queries
      */
     public function initializeObject()
     {
-        /** @var \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $defaultQuerySettings */
-        $defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
+        $defaultQuerySettings = $this->objectManager->get(QuerySettingsInterface::class);
         $defaultQuerySettings->setRespectStoragePage(false);
         $this->setDefaultQuerySettings($defaultQuerySettings);
     }
index 80a6c73..e9e2df3 100644 (file)
@@ -14,11 +14,19 @@ namespace TYPO3\CMS\Extensionmanager\Report;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository;
+use TYPO3\CMS\Extensionmanager\Utility\ListUtility;
+use TYPO3\CMS\Reports\Status;
+use TYPO3\CMS\Reports\StatusProviderInterface;
+
 /**
  * Extension status reports
  * @internal This class is a specific EXT:reports implementation and is not part of the Public TYPO3 API.
  */
-class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
+class ExtensionStatus implements StatusProviderInterface
 {
     /**
      * @var string
@@ -36,22 +44,22 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
     protected $error = '';
 
     /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+     * @var ObjectManager
      */
     protected $objectManager;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository
+     * @var RepositoryRepository
      */
     protected $repositoryRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+     * @var ListUtility
      */
     protected $listUtility;
 
     /**
-     * @var \TYPO3\CMS\Core\Localization\LanguageService
+     * @var LanguageService
      */
     protected $languageService;
 
@@ -60,10 +68,10 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
      */
     public function __construct()
     {
-        $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $this->repositoryRepository = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class);
-        $this->listUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ListUtility::class);
-        $this->languageService = $this->objectManager->get(\TYPO3\CMS\Core\Localization\LanguageService::class);
+        $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
+        $this->repositoryRepository = $this->objectManager->get(RepositoryRepository::class);
+        $this->listUtility = $this->objectManager->get(ListUtility::class);
+        $this->languageService = $this->objectManager->get(LanguageService::class);
         $this->languageService->includeLLFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf');
     }
 
@@ -89,7 +97,7 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
     /**
      * Check main repository status: existence, has extensions, last update younger than 7 days
      *
-     * @return \TYPO3\CMS\Reports\Status
+     * @return Status
      */
     protected function getMainRepositoryStatus()
     {
@@ -99,20 +107,20 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
         if ($mainRepository === null) {
             $value = $this->languageService->getLL('report.status.mainRepository.notFound.value');
             $message = $this->languageService->getLL('report.status.mainRepository.notFound.message');
-            $severity = \TYPO3\CMS\Reports\Status::ERROR;
+            $severity = Status::ERROR;
         } elseif ($mainRepository->getLastUpdate()->getTimestamp() < $GLOBALS['EXEC_TIME'] - 24 * 60 * 60 * 7) {
             $value = $this->languageService->getLL('report.status.mainRepository.notUpToDate.value');
             $message = $this->languageService->getLL('report.status.mainRepository.notUpToDate.message');
-            $severity = \TYPO3\CMS\Reports\Status::NOTICE;
+            $severity = Status::NOTICE;
         } else {
             $value = $this->languageService->getLL('report.status.mainRepository.upToDate.value');
             $message = '';
-            $severity = \TYPO3\CMS\Reports\Status::OK;
+            $severity = Status::OK;
         }
 
-        /** @var \TYPO3\CMS\Reports\Status $status */
+        /** @var Status $status */
         $status = $this->objectManager->get(
-            \TYPO3\CMS\Reports\Status::class,
+            Status::class,
             $this->languageService->getLL('report.status.mainRepository.title'),
             $value,
             $message,
@@ -181,7 +189,7 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
         if (empty($loadedInsecure)) {
             $value = $this->languageService->getLL('report.status.loadedExtensions.noInsecureExtensionLoaded.value');
             $message = '';
-            $severity = \TYPO3\CMS\Reports\Status::OK;
+            $severity = Status::OK;
         } else {
             $value = sprintf(
                 $this->languageService->getLL('report.status.loadedExtensions.insecureExtensionLoaded.value'),
@@ -199,10 +207,10 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                 $this->languageService->getLL('report.status.loadedExtensions.insecureExtensionLoaded.message'),
                 implode('', $extensionList)
             );
-            $severity = \TYPO3\CMS\Reports\Status::ERROR;
+            $severity = Status::ERROR;
         }
         $result->loaded = $this->objectManager->get(
-            \TYPO3\CMS\Reports\Status::class,
+            Status::class,
             $this->languageService->getLL('report.status.loadedExtensions.title'),
             $value,
             $message,
@@ -212,7 +220,7 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
         if (empty($existingInsecure)) {
             $value = $this->languageService->getLL('report.status.existingExtensions.noInsecureExtensionExists.value');
             $message = '';
-            $severity = \TYPO3\CMS\Reports\Status::OK;
+            $severity = Status::OK;
         } else {
             $value = sprintf(
                 $this->languageService->getLL('report.status.existingExtensions.insecureExtensionExists.value'),
@@ -230,10 +238,10 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                 $this->languageService->getLL('report.status.existingExtensions.insecureExtensionExists.message'),
                 implode('', $extensionList)
             );
-            $severity = \TYPO3\CMS\Reports\Status::WARNING;
+            $severity = Status::WARNING;
         }
         $result->existing = $this->objectManager->get(
-            \TYPO3\CMS\Reports\Status::class,
+            Status::class,
             $this->languageService->getLL('report.status.existingExtensions.title'),
             $value,
             $message,
@@ -243,7 +251,7 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
         if (empty($loadedOutdated)) {
             $value = $this->languageService->getLL('report.status.loadedOutdatedExtensions.noOutdatedExtensionLoaded.value');
             $message = '';
-            $severity = \TYPO3\CMS\Reports\Status::OK;
+            $severity = Status::OK;
         } else {
             $value = sprintf(
                 $this->languageService->getLL('report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.value'),
@@ -261,10 +269,10 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                 $this->languageService->getLL('report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message'),
                 implode('', $extensionList)
             );
-            $severity = \TYPO3\CMS\Reports\Status::WARNING;
+            $severity = Status::WARNING;
         }
         $result->loadedoutdated = $this->objectManager->get(
-            \TYPO3\CMS\Reports\Status::class,
+            Status::class,
             $this->languageService->getLL('report.status.loadedOutdatedExtensions.title'),
             $value,
             $message,
@@ -274,7 +282,7 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
         if (empty($existingOutdated)) {
             $value = $this->languageService->getLL('report.status.existingOutdatedExtensions.noOutdatedExtensionExists.value');
             $message = '';
-            $severity = \TYPO3\CMS\Reports\Status::OK;
+            $severity = Status::OK;
         } else {
             $value = sprintf(
                 $this->languageService->getLL('report.status.existingOutdatedExtensions.outdatedExtensionExists.value'),
@@ -292,10 +300,10 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                 $this->languageService->getLL('report.status.existingOutdatedExtensions.outdatedExtensionExists.message'),
                 implode('', $extensionList)
             );
-            $severity = \TYPO3\CMS\Reports\Status::WARNING;
+            $severity = Status::WARNING;
         }
         $result->existingoutdated = $this->objectManager->get(
-            \TYPO3\CMS\Reports\Status::class,
+            Status::class,
             $this->languageService->getLL('report.status.existingOutdatedExtensions.title'),
             $value,
             $message,
index 25e587c..a15f255 100644 (file)
@@ -14,38 +14,44 @@ namespace TYPO3\CMS\Extensionmanager\Service;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
+use TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Utility\DependencyUtility;
+use TYPO3\CMS\Extensionmanager\Utility\DownloadUtility;
+use TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility;
+use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
 
 /**
  * Service class for managing multiple step processes (dependencies for example)
  */
-class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface
+class ExtensionManagementService implements SingletonInterface
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue
+     * @var DownloadQueue
      */
     protected $downloadQueue;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
+     * @var DependencyUtility
      */
     protected $dependencyUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+     * @var InstallUtility
      */
     protected $installUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility
+     * @var ExtensionModelUtility
      */
     protected $extensionModelUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility
+     * @var DownloadUtility
      */
     protected $downloadUtility;
 
@@ -60,41 +66,41 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface
     protected $skipDependencyCheck = false;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue $downloadQueue
+     * @param DownloadQueue $downloadQueue
      */
-    public function injectDownloadQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue $downloadQueue)
+    public function injectDownloadQueue(DownloadQueue $downloadQueue)
     {
         $this->downloadQueue = $downloadQueue;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility
+     * @param DependencyUtility $dependencyUtility
      */
-    public function injectDependencyUtility(\TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility)
+    public function injectDependencyUtility(DependencyUtility $dependencyUtility)
     {
         $this->dependencyUtility = $dependencyUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
+     * @param InstallUtility $installUtility
      */
-    public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility)
+    public function injectInstallUtility(InstallUtility $installUtility)
     {
         $this->installUtility = $installUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility $extensionModelUtility
+     * @param ExtensionModelUtility $extensionModelUtility
      */
-    public function injectExtensionModelUtility(\TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility $extensionModelUtility)
+    public function injectExtensionModelUtility(ExtensionModelUtility $extensionModelUtility)
     {
         $this->extensionModelUtility = $extensionModelUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility
+     * @param DownloadUtility $downloadUtility
      */
-    public function injectDownloadUtility(\TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility)
+    public function injectDownloadUtility(DownloadUtility $downloadUtility)
     {
         $this->downloadUtility = $downloadUtility;
     }
index 9a8de43..80302e3 100644 (file)
@@ -14,11 +14,17 @@ namespace TYPO3\CMS\Extensionmanager\Task;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
+use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
+use TYPO3\CMS\Scheduler\Task\AbstractTask;
+
 /**
  * Update extension list from TER task
  * @internal This class is a specific EXT:scheduler task implementation and is not part of the Public TYPO3 API.
  */
-class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
+class UpdateExtensionListTask extends AbstractTask
 {
     /**
      * Public method, called by scheduler.
@@ -28,28 +34,9 @@ class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
     public function execute()
     {
         // Throws exceptions if something went wrong
-        $this->updateExtensionList();
-
+        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
+        $objectManager->get(Helper::class)->updateExtList();
+        $objectManager->get(PersistenceManager::class)->persistAll();
         return true;
     }
-
-    /**
-     * Update extension list
-     *
-     * @TODO: Adapt to multiple repositories if the Helper can handle this
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
-     */
-    protected function updateExtensionList()
-    {
-        /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
-        $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-
-        /** @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper */
-        $repositoryHelper = $objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper::class);
-        $repositoryHelper->updateExtList();
-
-        /** @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager $persistenceManager */
-        $persistenceManager = $objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
-        $persistenceManager->persistAll();
-    }
 }
index 61628d7..7eaae41 100644 (file)
@@ -28,11 +28,6 @@ use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
 class TerUtility
 {
     /**
-     * @var string
-     */
-    public $wsdlUrl;
-
-    /**
      * Fetches an extension from the given mirror
      *
      * @param string $extensionKey Extension Key
@@ -67,43 +62,6 @@ class TerUtility
     }
 
     /**
-     * Decode server data
-     * This is information like the extension list, extension
-     * information etc., return data after uploads (new em_conf)
-     * On success, returns an array with data array and stats
-     * array as key 0 and 1.
-     *
-     * @param string $externalData Data stream from remove server
-     * @throws ExtensionManagerException
-     * @return array $externalData
-     * @see fetchServerData()
-     * @see processRepositoryReturnData()
-     */
-    public function decodeServerData($externalData)
-    {
-        $parts = explode(':', $externalData, 4);
-        $dat = base64_decode($parts[2]);
-        gzuncompress($dat);
-        // compare hashes ignoring any leading whitespace. See bug #0000365.
-        if (ltrim($parts[0]) == md5($dat)) {
-            if ($parts[1] === 'gzcompress') {
-                if (function_exists('gzuncompress')) {
-                    $dat = gzuncompress($dat);
-                } else {
-                    throw new ExtensionManagerException('Decoding Error: No decompressor available for compressed content. gzuncompress() function is not available!', 1342859463);
-                }
-            }
-            $listArr = unserialize($dat, ['allowed_classes' => false]);
-            if (!is_array($listArr)) {
-                throw new ExtensionManagerException('Error: Unserialized information was not an array - strange!', 1342859489);
-            }
-        } else {
-            throw new ExtensionManagerException('Error: MD5 hashes in T3X data did not match!', 1342859505);
-        }
-        return $listArr;
-    }
-
-    /**
      * Decodes extension upload array.
      * This kind of data is when an extension is uploaded to TER
      *
index 09404d3..c736505 100644 (file)
@@ -14,40 +14,39 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\VersionNumberUtility;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Dependency;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
 use TYPO3\CMS\Extensionmanager\Exception;
+use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
 
 /**
  * Utility for dealing with dependencies
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
  */
-class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
+class DependencyUtility implements SingletonInterface
 {
     /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManager
-     */
-    protected $objectManager;
-
-    /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+     * @var ListUtility
      */
     protected $listUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+     * @var EmConfUtility
      */
     protected $emConfUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+     * @var ExtensionManagementService
      */
     protected $managementService;
 
@@ -72,41 +71,33 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
     protected $skipDependencyCheck = false;
 
     /**
-     * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
-     */
-    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
-    {
-        $this->objectManager = $objectManager;
-    }
-
-    /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
+     * @param ListUtility $listUtility
      */
-    public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility)
+    public function injectListUtility(ListUtility $listUtility)
     {
         $this->listUtility = $listUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
+     * @param EmConfUtility $emConfUtility
      */
-    public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility)
+    public function injectEmConfUtility(EmConfUtility $emConfUtility)
     {
         $this->emConfUtility = $emConfUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
+     * @param ExtensionManagementService $managementService
      */
-    public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService)
+    public function injectManagementService(ExtensionManagementService $managementService)
     {
         $this->managementService = $managementService;
     }
@@ -370,7 +361,7 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
     protected function getExtensionFromInExtensionRepository($extensionKey)
     {
         if ($this->localExtensionStorage !== '' && is_dir($this->localExtensionStorage)) {
-            $extList = \TYPO3\CMS\Core\Utility\GeneralUtility::get_dirs($this->localExtensionStorage);
+            $extList = GeneralUtility::get_dirs($this->localExtensionStorage);
             if (in_array($extensionKey, $extList)) {
                 $this->managementService->markExtensionForCopy($extensionKey, $this->localExtensionStorage);
                 return true;
@@ -613,7 +604,7 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
      * @param Extension[] $extensions
      * @param bool $showUnsuitable
      *
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Extension[]
+     * @return Extension[]
      */
     public function filterYoungestVersionOfExtensionList(array $extensions, $showUnsuitable)
     {
index 330baae..a981451 100644 (file)
@@ -14,19 +14,25 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\SingletonInterface;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+use TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility;
+use TYPO3\CMS\Extensionmanager\Utility\Repository\Helper;
+
 /**
  * Utility for Downloading Extensions
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
  */
-class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface
+class DownloadUtility implements SingletonInterface
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
+     * @var TerUtility
      */
     protected $terUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
+     * @var Helper
      */
     protected $repositoryHelper;
 
@@ -36,30 +42,30 @@ class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface
     protected $downloadPath = 'Local';
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+     * @var FileHandlingUtility
      */
     protected $fileHandlingUtility;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility
+     * @param TerUtility $terUtility
      */
-    public function injectTerUtility(\TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility)
+    public function injectTerUtility(TerUtility $terUtility)
     {
         $this->terUtility = $terUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper
+     * @param Helper $repositoryHelper
      */
-    public function injectRepositoryHelper(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper)
+    public function injectRepositoryHelper(Helper $repositoryHelper)
     {
         $this->repositoryHelper = $repositoryHelper;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
+     * @param FileHandlingUtility $fileHandlingUtility
      */
-    public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility)
+    public function injectFileHandlingUtility(FileHandlingUtility $fileHandlingUtility)
     {
         $this->fileHandlingUtility = $fileHandlingUtility;
     }
@@ -67,9 +73,9 @@ class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface
     /**
      * Download an extension
      *
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+     * @param Extension $extension
      */
-    public function download(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
+    public function download(Extension $extension)
     {
         $mirrorUrl = $this->repositoryHelper->getMirrors()->getMirrorUrl();
         $fetchedExtension = $this->terUtility->fetchExtension($extension->getExtensionKey(), $extension->getVersion(), $extension->getMd5hash(), $mirrorUrl);
@@ -82,12 +88,12 @@ class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface
      * Set the download path
      *
      * @param string $downloadPath
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+     * @throws ExtensionManagerException
      */
     public function setDownloadPath($downloadPath)
     {
-        if (!in_array($downloadPath, \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes())) {
-            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($downloadPath . ' not in allowed download paths', 1344766387);
+        if (!in_array($downloadPath, Extension::returnAllowedInstallTypes())) {
+            throw new ExtensionManagerException($downloadPath . ' not in allowed download paths', 1344766387);
         }
         $this->downloadPath = $downloadPath;
     }
index 59e50e2..f7e38f5 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
 
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\SingletonInterface;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 
 /**
  * Utility for dealing with ext_emconf
@@ -48,11 +49,11 @@ class EmConfUtility implements SingletonInterface
      * Sets dependencies from TER data if any
      *
      * @param array $extensionData
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension Extension object from TER data
+     * @param Extension $extension Extension object from TER data
      * @return string
      * @internal
      */
-    public function constructEmConf(array $extensionData, \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension = null)
+    public function constructEmConf(array $extensionData, Extension $extension = null)
     {
         if (is_object($extension) && empty($extensionData['EM_CONF']['constraints'])) {
             $extensionData['EM_CONF']['constraints'] = unserialize($extension->getSerializedDependencies(), ['allowed_classes' => false]);
index d4366a8..21849ae 100644 (file)
@@ -14,6 +14,11 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\VersionNumberUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Dependency;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+
 /**
  * Utility for dealing with extension model related helper functions
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
@@ -21,14 +26,14 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
 class ExtensionModelUtility
 {
     /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+     * @var ObjectManager
      */
     protected $objectManager;
 
     /**
-     * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
+     * @param ObjectManager $objectManager
      */
-    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
+    public function injectObjectManager(ObjectManager $objectManager)
     {
         $this->objectManager = $objectManager;
     }
@@ -37,12 +42,11 @@ class ExtensionModelUtility
      * Map a legacy extension array to an object
      *
      * @param array $extensionArray
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Extension
+     * @return Extension
      */
     public function mapExtensionArrayToModel(array $extensionArray)
     {
-        /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension */
-        $extension = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension::class);
+        $extension = $this->objectManager->get(Extension::class);
         $extension->setExtensionKey($extensionArray['key']);
         if (isset($extensionArray['version'])) {
             $extension->setVersion($extensionArray['version']);
@@ -73,15 +77,14 @@ class ExtensionModelUtility
             }
             foreach ($dependencyValues as $dependency => $versions) {
                 if ($dependencyType && $dependency) {
-                    $versionNumbers = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionsStringToVersionNumbers($versions);
+                    $versionNumbers = VersionNumberUtility::convertVersionsStringToVersionNumbers($versions);
                     $lowest = $versionNumbers[0];
                     if (count($versionNumbers) === 2) {
                         $highest = $versionNumbers[1];
                     } else {
                         $highest = '';
                     }
-                    /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependencyObject */
-                    $dependencyObject = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency::class);
+                    $dependencyObject = $this->objectManager->get(Dependency::class);
                     $dependencyObject->setType($dependencyType);
                     // dynamically migrate 'cms' dependency to 'core' dependency
                     // see also \TYPO3\CMS\Core\Package\Package::getPackageMetaData
index 52eb2ed..6ca2c77 100644 (file)
@@ -1,12 +1,6 @@
 <?php
 namespace TYPO3\CMS\Extensionmanager\Utility;
 
-use TYPO3\CMS\Core\Core\Environment;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
-use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
-use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
-
 /*
  * This file is part of the TYPO3 CMS project.
  *
@@ -20,47 +14,55 @@ use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Core\Environment;
+use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\SingletonInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\PathUtility;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+
 /**
  * Utility for dealing with files and folders
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
  */
-class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface
+class FileHandlingUtility implements SingletonInterface
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+     * @var EmConfUtility
      */
     protected $emConfUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+     * @var InstallUtility
      */
     protected $installUtility;
 
     /**
-     * @var \TYPO3\CMS\Core\Localization\LanguageService
+     * @var LanguageService
      */
     protected $languageService;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
+     * @param EmConfUtility $emConfUtility
      */
-    public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility)
+    public function injectEmConfUtility(EmConfUtility $emConfUtility)
     {
         $this->emConfUtility = $emConfUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
+     * @param InstallUtility $installUtility
      */
-    public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility)
+    public function injectInstallUtility(InstallUtility $installUtility)
     {
         $this->installUtility = $installUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
+     * @param LanguageService $languageService
      */
-    public function injectLanguageService(\TYPO3\CMS\Core\Localization\LanguageService $languageService)
+    public function injectLanguageService(LanguageService $languageService)
     {
         $this->languageService = $languageService;
     }
index 14429ae..79ada72 100644 (file)
@@ -91,13 +91,6 @@ class ExtensionListUtility implements \SplObserver
     protected $maxRowsPerChunk = 50;
 
     /**
-     * Keeps indexes of fields that should not be quoted.
-     *
-     * @var array
-     */
-    protected static $fieldIndicesNoQuote = [2, 3, 5, 11, 13, 14, 15, 16];
-
-    /**
      * Keeps repository UID.
      *
      * The UID is necessary for inserting records.
index 772e529..f0cbc9a 100644 (file)
@@ -14,6 +14,13 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Importer;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+use TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractMirrorXmlParser;
+use TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractXmlParser;
+use TYPO3\CMS\Extensionmanager\Utility\Parser\XmlParserFactory;
+
 /**
  * Importer object for mirror list.
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
@@ -23,7 +30,7 @@ class MirrorListUtility implements \SplObserver
     /**
      * Keeps instance of a XML parser.
      *
-     * @var \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractMirrorXmlParser
+     * @var AbstractMirrorXmlParser
      */
     protected $parser;
 
@@ -38,16 +45,16 @@ class MirrorListUtility implements \SplObserver
      * Class constructor.
      *
      * Method retrieves and initializes extension XML parser instance
-     * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+     * @throws ExtensionManagerException
      */
     public function __construct()
     {
         // @todo catch parser exception
-        $this->parser = \TYPO3\CMS\Extensionmanager\Utility\Parser\XmlParserFactory::getParserInstance('mirror');
+        $this->parser = XmlParserFactory::getParserInstance('mirror');
         if (is_object($this->parser)) {
             $this->parser->attach($this);
         } else {
-            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+            throw new ExtensionManagerException(
                 static::class . ': No XML parser available.',
                 1476108687
             );
@@ -59,14 +66,13 @@ class MirrorListUtility implements \SplObserver
      * \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors with retrieved details.
      *
      * @param string $localMirrorListFile absolute path to local mirror xml.gz file
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors
+     * @return Mirrors
      */
     public function getMirrors($localMirrorListFile)
     {
         $zlibStream = 'compress.zlib://';
         $this->parser->parseXml($zlibStream . $localMirrorListFile);
-        /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors $objRepositoryMirrors */
-        $objRepositoryMirrors = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors::class);
+        $objRepositoryMirrors = GeneralUtility::makeInstance(Mirrors::class);
         $objRepositoryMirrors->setMirrors($this->arrTmpMirrors);
         $this->arrTmpMirrors = [];
         return $objRepositoryMirrors;
@@ -80,7 +86,7 @@ class MirrorListUtility implements \SplObserver
     public function update(\SplSubject $subject)
     {
         // @todo mirrorxml_abstract_parser
-        if (is_subclass_of($subject, \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractXmlParser::class)) {
+        if (is_subclass_of($subject, AbstractXmlParser::class)) {
             $this->arrTmpMirrors[] = $subject->getAll();
         }
     }
index d908203..878f006 100644 (file)
@@ -15,16 +15,19 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
+use Psr\Log\LoggerAwareInterface;
+use Psr\Log\LoggerAwareTrait;
 use Symfony\Component\Finder\Finder;
 use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
 use TYPO3\CMS\Core\Configuration\SiteConfiguration;
+use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Database\Schema\SchemaMigrator;
 use TYPO3\CMS\Core\Database\Schema\SqlReader;
-use TYPO3\CMS\Core\Log\LogLevel;
-use TYPO3\CMS\Core\Log\LogManager;
 use TYPO3\CMS\Core\Service\OpcodeCacheService;
+use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Core\Site\Entity\Site;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
@@ -36,12 +39,9 @@ use TYPO3\CMS\Impexp\Utility\ImportExportUtility;
  * Extension Manager Install Utility
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
  */
-class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
+class InstallUtility implements SingletonInterface, LoggerAwareInterface
 {
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManager
-     */
-    public $objectManager;
+    use LoggerAwareTrait;
 
     /**
      * @var \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
@@ -84,14 +84,6 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
     protected $registry;
 
     /**
-     * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
-     */
-    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
-    {
-        $this->objectManager = $objectManager;
-    }
-
-    /**
      * @param \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility
      */
     public function injectDependencyUtility(\TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility)
@@ -180,7 +172,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
             $this->cacheManager->flushCachesInGroup('system');
         }
         $this->reloadCaches();
-        $this->updateDatabase($extensionKeys);
+        $this->updateDatabase();
 
         foreach ($extensionKeys as $extensionKey) {
             $this->processExtensionSetup($extensionKey);
@@ -359,9 +351,9 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
     public function reloadCaches()
     {
         $this->reloadOpcache();
-        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf(false);
-        \TYPO3\CMS\Core\Core\Bootstrap::loadBaseTca(false);
-        \TYPO3\CMS\Core\Core\Bootstrap::loadExtTables(false);
+        ExtensionManagementUtility::loadExtLocalconf(false);
+        Bootstrap::loadBaseTca(false);
+        Bootstrap::loadExtTables(false);
     }
 
     /**
@@ -375,10 +367,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
     /**
      * Executes all safe database statements.
      * Tables and fields are created and altered. Nothing gets deleted or renamed here.
-     *
-     * @param array $extensionKeys
      */
-    protected function updateDatabase(array $extensionKeys)
+    protected function updateDatabase()
     {
         $sqlReader = GeneralUtility::makeInstance(SqlReader::class);
         $schemaMigrator = GeneralUtility::makeInstance(SchemaMigrator::class);
@@ -409,7 +399,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function saveDefaultConfiguration($extensionKey)
     {
-        $extensionConfiguration = $this->objectManager->get(ExtensionConfiguration::class);
+        $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class);
         $extensionConfiguration->synchronizeExtConfTemplateWithLocalConfiguration($extensionKey);
     }
 
@@ -450,18 +440,6 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
     }
 
     /**
-     * Checks if an update for an extension is available which also resolves dependencies.
-     *
-     * @param Extension $extensionData
-     * @return bool
-     * @internal
-     */
-    public function isUpdateAvailable(Extension $extensionData)
-    {
-        return (bool)$this->getUpdateableVersion($extensionData);
-    }
-
-    /**
      * Returns the updateable version for an extension which also resolves dependencies.
      *
      * @param Extension $extensionData
@@ -525,16 +503,14 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
             $importFileToUse = $possibleImportFile;
         }
         if ($importFileToUse !== null) {
-            /** @var ImportExportUtility $importExportUtility */
-            $importExportUtility = $this->objectManager->get(ImportExportUtility::class);
+            $importExportUtility = GeneralUtility::makeInstance(ImportExportUtility::class);
             try {
                 $importResult = $importExportUtility->importT3DFile(Environment::getPublicPath() . '/' . $importFileToUse, 0);
                 $this->registry->set('extensionDataImport', $extensionSiteRelPath . 'Initialisation/dataImported', 1);
                 $this->emitAfterExtensionT3DImportSignal($importFileToUse, $importResult);
                 return $importExportUtility->getImport();
             } catch (\ErrorException $e) {
-                $logger = $this->objectManager->get(LogManager::class)->getLogger(__CLASS__);
-                $logger->log(LogLevel::WARNING, $e->getMessage());
+                $this->logger->warning($e->getMessage(), ['exception' => $e]);
             }
         }
         return null;
@@ -634,7 +610,6 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
             return;
         }
 
-        $logger = $this->objectManager->get(LogManager::class)->getLogger(__CLASS__);
         $siteConfiguration = GeneralUtility::makeInstance(
             SiteConfiguration::class,
             $destinationFolder
@@ -648,8 +623,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
             foreach ($finder as $siteConfigDirectory) {
                 $siteIdentifier = $siteConfigDirectory->getBasename();
                 if (isset($existingSites[$siteIdentifier])) {
-                    $logger->log(
-                        LogLevel::WARNING,
+                    $this->logger->warning(
                         sprintf(
                             'Skipped importing site configuration from %s due to existing site identifier %s',
                             $extensionSiteRelPath,
@@ -675,8 +649,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
             $exportedPageId = $newSite->getRootPageId();
             $importedPageId = $importedPages[$exportedPageId] ?? null;
             if ($importedPageId === null) {
-                $logger->log(
-                    LogLevel::WARNING,
+                $this->logger->warning(
                     sprintf(
                         'Imported site configuration with identifier %s could not be mapped to imported page id',
                         $newSite->getIdentifier()
index e96ab39..c45d9da 100644 (file)
@@ -16,11 +16,13 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
 
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Package\PackageInterface;
+use TYPO3\CMS\Core\Package\PackageManager;
 use TYPO3\CMS\Core\Type\File\ImageInfo;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\VersionNumberUtility;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
 
 /**
  * Utility for dealing with extension list related functions
@@ -34,22 +36,22 @@ use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 class ListUtility implements \TYPO3\CMS\Core\SingletonInterface
 {
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+     * @var EmConfUtility
      */
     protected $emConfUtility;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+     * @var ExtensionRepository
      */
     protected $extensionRepository;
 
     /**
-     * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+     * @var InstallUtility
      */
     protected $installUtility;
 
     /**
-     * @var \TYPO3\CMS\Core\Package\PackageManager
+     * @var PackageManager
      */
     protected $packageManager;
 
@@ -64,33 +66,33 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface
     protected $availableExtensions;
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
+     * @param EmConfUtility $emConfUtility
      */
-    public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility)
+    public function injectEmConfUtility(EmConfUtility $emConfUtility)
     {
         $this->emConfUtility = $emConfUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
+     * @param ExtensionRepository $extensionRepository
      */
-    public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository)
+    public function injectExtensionRepository(ExtensionRepository $extensionRepository)
     {
         $this->extensionRepository = $extensionRepository;
     }
 
     /**
-     * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
+     * @param InstallUtility $installUtility
      */
-    public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility)
+    public function injectInstallUtility(InstallUtility $installUtility)
     {
         $this->installUtility = $installUtility;
     }
 
     /**
-     * @param \TYPO3\CMS\Core\Package\PackageManager $packageManager
+     * @param PackageManager $packageManager
      */
-    public function injectPackageManager(\TYPO3\CMS\Core\Package\PackageManager $packageManager)
+    public function injectPackageManager(PackageManager $packageManager)
     {
         $this->packageManager = $packageManager;
     }
index 7a42720..dc9de99 100644 (file)
@@ -42,27 +42,6 @@ abstract class AbstractMirrorXmlParser extends AbstractXmlParser
     protected $path;
 
     /**
-     * Keeps sponsor link of currently processed mirror.
-     *
-     * @var string
-     */
-    protected $sponsorlink;
-
-    /**
-     * Keeps sponsor logo location of currently processed mirror.
-     *
-     * @var string
-     */
-    protected $sponsorlogo;
-
-    /**
-     * Keeps sponsor name of currently processed mirror.
-     *
-     * @var string
-     */
-    protected $sponsorname;
-
-    /**
      * Keeps title of currently processed mirror.
      *
      * @var string
@@ -73,7 +52,7 @@ abstract class AbstractMirrorXmlParser extends AbstractXmlParser
      * Returns an associative array of all mirror properties.
      *
      * Valid array keys of returned array are:
-     * country, host, path, sponsorlink, sponsorlogo, sponsorname, title
+     * country, host, path, title
      *
      * @return array associative array of a mirror's properties
      */
@@ -84,9 +63,6 @@ abstract class AbstractMirrorXmlParser extends AbstractXmlParser
         $mirrorProperties['host'] = $this->host;
         $mirrorProperties['path'] = $this->path;
         $mirrorProperties['country'] = $this->country;
-        $mirrorProperties['sponsorname'] = $this->sponsorname;
-        $mirrorProperties['sponsorlink'] = $this->sponsorlink;
-        $mirrorProperties['sponsorlogo'] = $this->sponsorlogo;
         return $mirrorProperties;
     }
 
@@ -124,39 +100,6 @@ abstract class AbstractMirrorXmlParser extends AbstractXmlParser
     }
 
     /**
-     * Returns sponsor link of currently processed mirror.
-     *
-     * @return string URL of a sponsor's website
-     * @see getAll()
-     */
-    public function getSponsorlink()
-    {
-        return $this->sponsorlink;
-    }
-
-    /**
-     * Returns sponsor logo location of currently processed mirror.
-     *
-     * @return string a sponsor's logo location
-     * @see getAll()
-     */
-    public function getSponsorlogo()
-    {
-        return $this->sponsorlogo;
-    }
-
-    /**
-     * Returns sponsor name of currently processed mirror.
-     *
-     * @return string name of sponsor
-     * @see getAll()
-     */
-    public function getSponsorname()
-    {
-        return $this->sponsorname;
-    }
-
-    /**
      * Returns title of currently processed mirror.
      *
      * @return string title of mirror
@@ -172,7 +115,6 @@ abstract class AbstractMirrorXmlParser extends AbstractXmlParser
      */
     protected function resetProperties()
     {
-        $this->title = $this->host = $this->path = $this->country
-            = $this->sponsorname = $this->sponsorlink = $this->sponsorlogo = null;
+        $this->title = $this->host = $this->path = $this->country = null;
     }
 }
index 81651ba..b220fee 100644 (file)
@@ -86,15 +86,6 @@ class MirrorXmlPullParser extends AbstractMirrorXmlParser
             case 'country':
                 $this->country = $this->getElementValue($elementName);
                 break;
-            case 'name':
-                $this->sponsorname = $this->getElementValue($elementName);
-                break;
-            case 'link':
-                $this->sponsorlink = $this->getElementValue($elementName);
-                break;
-            case 'logo':
-                $this->sponsorlogo = $this->getElementValue($elementName);
-                break;
             default:
                 // Do nothing
         }
index 07e9e00..6eca5f2 100644 (file)
@@ -142,15 +142,6 @@ class MirrorXmlPushParser extends AbstractMirrorXmlParser
                 case 'country':
                     $this->country = $data;
                     break;
-                case 'name':
-                    $this->sponsorname = $data;
-                    break;
-                case 'link':
-                    $this->sponsorlink = $data;
-                    break;
-                case 'logo':
-                    $this->sponsorlogo = $data;
-                    break;
                 default:
                     // Do nothing
             }
index aea7bd5..9f0cd66 100644 (file)
@@ -38,12 +38,12 @@ class XmlParserFactory
      */
     protected static $parsers = [
         'extension' => [
-            \TYPO3\CMS\Extensionmanager\Utility\Parser\ExtensionXmlPushParser::class => 'ExtensionXmlPushParser.php',
-            \TYPO3\CMS\Extensionmanager\Utility\Parser\ExtensionXmlPullParser::class => 'ExtensionXmlPullParser.php',
+            ExtensionXmlPushParser::class => 'ExtensionXmlPushParser.php',
+            ExtensionXmlPullParser::class => 'ExtensionXmlPullParser.php',
         ],
         'mirror' => [
-            \TYPO3\CMS\Extensionmanager\Utility\Parser\MirrorXmlPushParser::class => 'MirrorXmlPushParser.php',
-            \TYPO3\CMS\Extensionmanager\Utility\Parser\MirrorXmlPullParser::class=> 'MirrorXmlPullParser.php',
+            MirrorXmlPushParser::class => 'MirrorXmlPushParser.php',
+            MirrorXmlPullParser::class=> 'MirrorXmlPullParser.php',
         ]
     ];
 
@@ -55,7 +55,7 @@ class XmlParserFactory
      *
      * @param string $parserType type of parser, one of extension and mirror
      * @param string $excludeClassNames (optional) comma-separated list of class names
-     * @return \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser an instance of an extension.xml parser
+     * @return AbstractExtensionXmlParser an instance of an extension.xml parser
      */
     public static function getParserInstance($parserType, $excludeClassNames = '')
     {
index 2912633..2bbb952 100644 (file)
@@ -17,8 +17,10 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Repository;
 use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Repository;
 use TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository;
 use TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository;
@@ -30,7 +32,7 @@ use TYPO3\CMS\Extensionmanager\Utility\Importer\MirrorListUtility;
  * Central utility class for repository handling.
  * @internal This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
  */
-class Helper implements \TYPO3\CMS\Core\SingletonInterface
+class Helper implements SingletonInterface
 {
     /**
      * ##########################################
@@ -66,11 +68,6 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface
     protected $repository;
 
     /**
-     * @var RepositoryRepository
-     */
-    protected $repositoryRepository;
-
-    /**
      * @var ExtensionRepository
      */
     protected $extensionRepository;
@@ -226,7 +223,7 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface
      * server.
      *
      * @param bool $forcedUpdateFromRemote if boolean TRUE, mirror configuration will always retrieved from remote server
-     * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors instance of repository mirrors class
+     * @return Mirrors instance of repository mirrors class
      * @throws ExtensionManagerException
      */
     public function getMirrors($forcedUpdateFromRemote = true)
index f388c3a..84a4c3c 100644 (file)
@@ -16,15 +16,12 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Utility;
  */
 
 use Prophecy\Argument;
-use Psr\Log\NullLogger;
 use Symfony\Component\Yaml\Yaml;
 use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Cache\Frontend\NullFrontend;
 use TYPO3\CMS\Core\Core\Environment;
-use TYPO3\CMS\Core\Log\LogManager;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extensionmanager\Utility\DependencyUtility;
 use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
 use TYPO3\CMS\Extensionmanager\Utility\ListUtility;
@@ -144,9 +141,7 @@ class InstallUtilityTest extends UnitTestCase
      */
     public function installCallsUpdateDatabase()
     {
-        $this->installMock->expects(self::once())
-            ->method('updateDatabase')
-            ->with([$this->extensionKey]);
+        $this->installMock->expects(self::once())->method('updateDatabase');
 
         $cacheManagerMock = $this->getMockBuilder(CacheManager::class)->getMock();
         $cacheManagerMock->expects(self::once())->method('flushCachesInGroup');
@@ -307,11 +302,6 @@ class InstallUtilityTest extends UnitTestCase
         $subject = new InstallUtility();
         $listUtility = $this->prophesize(ListUtility::class);
         $subject->injectListUtility($listUtility->reveal());
-        $logManagerProphecy = $this->prophesize(LogManager::class);
-        $logManagerProphecy->getLogger(InstallUtility::class)->willReturn(new NullLogger());
-        $objectManagerProphecy = $this->prophesize(ObjectManager::class);
-        $objectManagerProphecy->get(LogManager::class)->willReturn($logManagerProphecy->reveal());
-        $subject->injectObjectManager($objectManagerProphecy->reveal());
 
         $availableExtensions = [
             $extKey => [
@@ -376,11 +366,6 @@ class InstallUtilityTest extends UnitTestCase
         $subject = new InstallUtility();
         $listUtility = $this->prophesize(ListUtility::class);
         $subject->injectListUtility($listUtility->reveal());
-        $logManagerProphecy = $this->prophesize(LogManager::class);
-        $logManagerProphecy->getLogger(InstallUtility::class)->willReturn(new NullLogger());
-        $objectManagerProphecy = $this->prophesize(ObjectManager::class);
-        $objectManagerProphecy->get(LogManager::class)->willReturn($logManagerProphecy->reveal());
-        $subject->injectObjectManager($objectManagerProphecy->reveal());
 
         $availableExtensions = [
             $extKey => [