[TASK] Cleanup functionality in PackageManager.php 79/46379/3
authorBenni Mack <benni@typo3.org>
Fri, 29 Jan 2016 22:03:57 +0000 (23:03 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 29 Jan 2016 22:48:56 +0000 (23:48 +0100)
There are quite some quirks and leftovers which won't change
functionality but can be removed.

Resolves: #73021
Releases: master
Change-Id: If06fcc5cac7896c01c6e542b767e94aa414f23fa
Reviewed-on: https://review.typo3.org/46379
Reviewed-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Compatibility/LoadedExtensionArrayElement.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Package/PackageManager.php
typo3/sysext/core/Classes/Package/UnitTestPackageManager.php

index 08fcc62..3ebd4df 100644 (file)
@@ -75,10 +75,6 @@ class LoadedExtensionArrayElement implements \IteratorAggregate, \ArrayAccess, \
             $packageType = null;
             // Determine if extension is installed locally, globally or system (in this order)
             switch (implode('/', array_slice($relativePackagePathToPathSiteSegments, 0, 2))) {
-                case 'typo3conf/Packages':
-                    $packageType = 'C';
-                    $relativePackagePathToPathTypo3 = '../typo3conf/Packages/' . implode('/', array_slice($relativePackagePathToPathSiteSegments, 2));
-                    break;
                 case 'typo3conf/ext':
                     $packageType = 'L';
                     $relativePackagePathToPathTypo3 = '../typo3conf/ext/' . implode('/', array_slice($relativePackagePathToPathSiteSegments, 2));
index aa24164..3b17242 100644 (file)
@@ -426,7 +426,7 @@ class Bootstrap
         $dependencyResolver = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\DependencyResolver::class);
         $dependencyResolver->injectDependencyOrderingService(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Service\DependencyOrderingService::class));
         $packageManager->injectDependencyResolver($dependencyResolver);
-        $packageManager->initialize($this);
+        $packageManager->initialize();
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
         return $this;
     }
index 3f874a3..67b406f 100644 (file)
@@ -35,11 +35,6 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface
     protected $dependencyResolver;
 
     /**
-     * @var Bootstrap
-     */
-    protected $bootstrap;
-
-    /**
      * @var \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
      */
     protected $coreCache;
@@ -133,25 +128,16 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface
     /**
      * Initializes the package manager
      *
-     * @param Bootstrap $bootstrap The current bootstrap
-     *
      * @return void
      */
-    public function initialize(Bootstrap $bootstrap)
+    public function initialize()
     {
-        $this->bootstrap = $bootstrap;
-
-        $loadedFromCache = false;
         try {
             $this->loadPackageManagerStatesFromCache();
-            $loadedFromCache = true;
         } catch (Exception\PackageManagerCacheUnavailableException $exception) {
             $this->loadPackageStates();
             $this->initializePackageObjects();
             $this->initializeCompatibilityLoadedExtArray();
-        }
-
-        if (!$loadedFromCache) {
             $this->saveToPackageCache();
         }
     }
index 62a23b2..3f95c6f 100644 (file)
@@ -25,13 +25,10 @@ class UnitTestPackageManager extends PackageManager
     /**
      * Initializes the package manager
      *
-     * @param \TYPO3\CMS\Core\Core\Bootstrap $bootstrap The current bootstrap
      * @return void
      */
-    public function initialize(\TYPO3\CMS\Core\Core\Bootstrap $bootstrap)
+    public function initialize()
     {
-        $this->bootstrap = $bootstrap;
-
         $this->scanAvailablePackages();
         $this->activePackages = $this->packages;
     }