1
0
Fork 0

Fix handling of partial package listings containing replaces/provides

pull/5831/merge
Jordi Boggiano 2016-12-06 21:56:09 +01:00
parent 817b2747c7
commit 9ee17ef6ff
1 changed files with 14 additions and 1 deletions

View File

@ -785,7 +785,20 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$this->partialPackagesByName = array();
foreach ($rootData['packages'] as $package => $versions) {
$this->partialPackagesByName[strtolower($package)] = $versions;
$package = strtolower($package);
foreach ($versions as $version) {
$this->partialPackagesByName[$package][] = $version;
if (!empty($version['provide']) && is_array($version['provide'])) {
foreach ($version['provide'] as $provided => $providedVersion) {
$this->partialPackagesByName[strtolower($provided)][] = $version;
}
}
if (!empty($version['replace']) && is_array($version['replace'])) {
foreach ($version['replace'] as $provided => $providedVersion) {
$this->partialPackagesByName[strtolower($provided)][] = $version;
}
}
}
}
// wipe rootData as it is fully consumed at this point and this saves some memory