1
0
Fork 0

Remove support for the first version of the compression algo (#7906)

pull/7999/head
Jordi Boggiano 2019-02-20 11:10:44 +01:00 committed by GitHub
parent 177f21ec5c
commit 2e204b0161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 46 deletions

View File

@ -62,32 +62,10 @@ class ArrayLoader implements LoaderInterface
public function loadPackages(array $versions, $class) public function loadPackages(array $versions, $class)
{ {
static $uniqKeys = array('version', 'version_normalized', 'source', 'dist', 'time');
$packages = array(); $packages = array();
$linkCache = array(); $linkCache = array();
foreach ($versions as $version) { foreach ($versions as $version) {
if (isset($version['versions'])) {
$baseVersion = $version;
foreach ($uniqKeys as $key) {
unset($baseVersion[$key.'s']);
}
foreach ($version['versions'] as $index => $dummy) {
$unpackedVersion = $baseVersion;
foreach ($uniqKeys as $key) {
$unpackedVersion[$key] = $version[$key.'s'][$index];
}
$package = $this->createObject($unpackedVersion, $class);
$this->configureCachedLinks($linkCache, $package, $unpackedVersion);
$package = $this->configureObject($package, $unpackedVersion);
$packages[] = $package;
}
} else {
$package = $this->createObject($version, $class); $package = $this->createObject($version, $class);
$this->configureCachedLinks($linkCache, $package, $version); $this->configureCachedLinks($linkCache, $package, $version);
@ -95,7 +73,6 @@ class ArrayLoader implements LoaderInterface
$packages[] = $package; $packages[] = $package;
} }
}
return $packages; return $packages;
} }

View File

@ -645,21 +645,8 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
unset($expanded, $expandedVersion, $versionData); unset($expanded, $expandedVersion, $versionData);
} }
static $uniqKeys = array('version', 'version_normalized', 'source', 'dist', 'time');
$versionsToLoad = array(); $versionsToLoad = array();
foreach ($versions as $version) { foreach ($versions as $version) {
if (isset($version['version_normalizeds'])) {
foreach ($version['version_normalizeds'] as $index => $normalizedVersion) {
if (!$repo->isVersionAcceptable($isPackageAcceptableCallable, $constraint, $realName, $normalizedVersion)) {
foreach ($uniqKeys as $key) {
unset($version[$key.'s'][$index]);
}
}
}
if (count($version['version_normalizeds'])) {
$versionsToLoad[] = $version;
}
} else {
if (!isset($version['version_normalized'])) { if (!isset($version['version_normalized'])) {
$version['version_normalized'] = $repo->versionParser->normalize($version['version']); $version['version_normalized'] = $repo->versionParser->normalize($version['version']);
} }
@ -668,7 +655,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$versionsToLoad[] = $version; $versionsToLoad[] = $version;
} }
} }
}
$loadedPackages = $repo->createPackages($versionsToLoad, 'Composer\Package\CompletePackage'); $loadedPackages = $repo->createPackages($versionsToLoad, 'Composer\Package\CompletePackage');
foreach ($loadedPackages as $package) { foreach ($loadedPackages as $package) {