Merge remote-tracking branch 'naderman/remove-outdated-alias-code'
commit
794b51fcdd
|
@ -55,33 +55,11 @@ class FilesystemRepository extends ArrayRepository implements WritableRepository
|
||||||
throw new \UnexpectedValueException('Could not parse package list from the '.$this->file->getPath().' repository');
|
throw new \UnexpectedValueException('Could not parse package list from the '.$this->file->getPath().' repository');
|
||||||
}
|
}
|
||||||
|
|
||||||
$aliases = array();
|
|
||||||
|
|
||||||
$loader = new ArrayLoader();
|
$loader = new ArrayLoader();
|
||||||
foreach ($packages as $packageData) {
|
foreach ($packages as $packageData) {
|
||||||
$package = $loader->load($packageData);
|
$package = $loader->load($packageData);
|
||||||
|
|
||||||
// aliases need to be looked up in the end to set up references correctly
|
|
||||||
if ($this instanceof InstalledRepositoryInterface && !empty($packageData['alias'])) {
|
|
||||||
$aliases[] = array(
|
|
||||||
'package' => $package,
|
|
||||||
'alias' => $packageData['alias'],
|
|
||||||
'alias_pretty' => $packageData['alias_pretty']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addPackage($package);
|
$this->addPackage($package);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($aliases as $aliasData) {
|
|
||||||
$temporaryPackage = $aliasData['package'];
|
|
||||||
|
|
||||||
$package = $this->findPackage($temporaryPackage->getName(), $temporaryPackage->getVersion());
|
|
||||||
|
|
||||||
$package->setAlias($aliasData['alias']);
|
|
||||||
$package->setPrettyAlias($aliasData['alias_pretty']);
|
|
||||||
$this->addPackage($this->createAliasPackage($package, $aliasData['alias'], $aliasData['alias_pretty']));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reload()
|
public function reload()
|
||||||
|
|
Loading…
Reference in New Issue