1
0
Fork 0

No need to alias platform packages before the repository set as the pool builder already does it

pull/8535/head
Jordi Boggiano 2020-01-17 14:51:26 +01:00
parent 79c59805ad
commit 8bb472a608
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 0 additions and 22 deletions

View File

@ -170,7 +170,6 @@ class PoolBuilder
$aliasPackage = new AliasPackage($basePackage, $alias['alias_normalized'], $alias['alias']);
$aliasPackage->setRootPackageAlias(true);
$package->getRepository()->addPackage($aliasPackage); // TODO do we need this?
$this->packages[] = $aliasPackage;
$this->aliasMap[spl_object_hash($aliasPackage->getAliasOf())][$index+1] = $aliasPackage;
}

View File

@ -697,8 +697,6 @@ class Installer
*/
private function createRepositorySet(PlatformRepository $platformRepo, array $rootAliases = array(), $lockedRepository = null)
{
$this->aliasPlatformPackages($platformRepo, $rootAliases);
// TODO what's the point of rootConstraints at all, we generate the package pool taking them into account anyway?
// TODO maybe we can drop the lockedRepository here
// TODO if this gets called in doInstall, this->update is still true?!
@ -830,25 +828,6 @@ class Installer
return $normalizedAliases;
}
/**
* @param PlatformRepository $platformRepo
* @param array $aliases
*/
private function aliasPlatformPackages(PlatformRepository $platformRepo, $aliases)
{
// TODO should the repository set do this?
foreach ($aliases as $packageName => $versions) {
foreach ($versions as $version => $alias) {
$packages = $platformRepo->findPackages($packageName, $version);
foreach ($packages as $package) {
$aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']);
$aliasPackage->setRootPackageAlias(true);
$platformRepo->addPackage($aliasPackage);
}
}
}
}
/**
* @param PackageInterface $package
* @return bool