1
0
Fork 0

Allow PlatformRepository packages to be aliased

pull/746/head
Jordi Boggiano 2012-06-05 17:41:50 +02:00
parent d29a387bcb
commit bc7e983b1e
1 changed files with 9 additions and 4 deletions

View File

@ -145,11 +145,12 @@ class Installer
$installedRootPackage->setRequires(array()); $installedRootPackage->setRequires(array());
$installedRootPackage->setDevRequires(array()); $installedRootPackage->setDevRequires(array());
$platformRepo = new PlatformRepository();
$repos = array_merge( $repos = array_merge(
$this->repositoryManager->getLocalRepositories(), $this->repositoryManager->getLocalRepositories(),
array( array(
new InstalledArrayRepository(array($installedRootPackage)), new InstalledArrayRepository(array($installedRootPackage)),
new PlatformRepository(), $platformRepo,
) )
); );
$installedRepo = new CompositeRepository($repos); $installedRepo = new CompositeRepository($repos);
@ -157,7 +158,7 @@ class Installer
$installedRepo->addRepository($this->additionalInstalledRepository); $installedRepo->addRepository($this->additionalInstalledRepository);
} }
$aliases = $this->aliasPackages(); $aliases = $this->aliasPackages($platformRepo);
if ($this->runScripts) { if ($this->runScripts) {
// dispatch pre event // dispatch pre event
@ -440,7 +441,7 @@ class Installer
return true; return true;
} }
private function aliasPackages() private function aliasPackages(PlatformRepository $platformRepo)
{ {
if (!$this->update && $this->locker->isLocked()) { if (!$this->update && $this->locker->isLocked()) {
$aliases = $this->locker->getAliases(); $aliases = $this->locker->getAliases();
@ -449,7 +450,11 @@ class Installer
} }
foreach ($aliases as $alias) { foreach ($aliases as $alias) {
foreach ($this->repositoryManager->findPackages($alias['package'], $alias['version']) as $package) { $packages = array_merge(
$platformRepo->findPackages($alias['package'], $alias['version']),
$this->repositoryManager->findPackages($alias['package'], $alias['version'])
);
foreach ($packages as $package) {
$package->setAlias($alias['alias_normalized']); $package->setAlias($alias['alias_normalized']);
$package->setPrettyAlias($alias['alias']); $package->setPrettyAlias($alias['alias']);
$package->getRepository()->addPackage($aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias'])); $package->getRepository()->addPackage($aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']));