[TASK] Only show active packages in PackageStates.php
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Package / DependencyResolver.php
index fec6194..9df659c 100644 (file)
@@ -24,11 +24,6 @@ use TYPO3\CMS\Core\Service\DependencyOrderingService;
  */
 class DependencyResolver
 {
-    /**
-     * Folder with framework extensions
-     */
-    const SYSEXT_FOLDER = 'typo3/sysext';
-
     /**
      * @var DependencyOrderingService
      */
@@ -49,24 +44,7 @@ class DependencyResolver
      */
     public function sortPackageStatesConfigurationByDependency(array $packageStatesConfiguration)
     {
-        // We just want to consider active packages
-        $activePackageStatesConfiguration = array_filter($packageStatesConfiguration, function ($packageState) {
-            return isset($packageState['state']) && $packageState['state'] === 'active';
-        });
-        $inactivePackageStatesConfiguration = array_diff_key($packageStatesConfiguration, $activePackageStatesConfiguration);
-
-        $sortedPackageKeys = $this->dependencyOrderingService->calculateOrder($this->buildDependencyGraph($activePackageStatesConfiguration));
-
-        // Reorder the package states according to the loading order
-        $newPackageStatesConfiguration = array();
-        foreach ($sortedPackageKeys as $packageKey) {
-            $newPackageStatesConfiguration[$packageKey] = $packageStatesConfiguration[$packageKey];
-        }
-
-        // Append the inactive configurations again
-        $newPackageStatesConfiguration = array_merge($newPackageStatesConfiguration, $inactivePackageStatesConfiguration);
-
-        return $newPackageStatesConfiguration;
+        return $this->dependencyOrderingService->calculateOrder($this->buildDependencyGraph($packageStatesConfiguration));
     }
 
     /**