[TASK] Reduce diff size on PackageStates changes 48/40048/2
authorMarkus Klein <markus.klein@typo3.org>
Sat, 6 Jun 2015 13:55:27 +0000 (15:55 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 6 Jun 2015 14:24:47 +0000 (16:24 +0200)
Sorting the available packages by key before running the
DependencyResolver ensures that equivalent (loading order does not matter)
packages have a fixed order in the PackageStates in the end.

Resolves: #67330
Releases: master, 6.2
Change-Id: Ibd7061aa8b1735f2bd5b7cbb9df2ba19b90bb884
Reviewed-on: http://review.typo3.org/40048
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>

index 4ded5a2..b908e8b 100644 (file)
@@ -756,6 +756,8 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface {
        protected function sortAvailablePackagesByDependencies() {
+               // sort the packages by key at first, so we get a stable sorting of "equivalent" packages afterwards
+               ksort($this->packageStatesConfiguration['packages']);
                $this->packageStatesConfiguration['packages'] = $this->dependencyResolver->sortPackageStatesConfigurationByDependency($this->packageStatesConfiguration['packages']);
                // Reorder the packages according to the loading order