1
0
Fork 0

Make sure aliased packages created by the locker are available in the pool

pull/606/merge
Jordi Boggiano 2012-04-24 10:49:49 +02:00
parent aff7745231
commit cc3d91f75c
2 changed files with 9 additions and 2 deletions

View File

@ -186,6 +186,11 @@ class Installer
protected function doInstall($localRepo, $installedRepo, $aliases, $devMode = false)
{
// initialize locker to create aliased packages
if (!$this->update && $this->locker->isLocked($devMode)) {
$lockedPackages = $this->locker->getLockedPackages($devMode);
}
// creating repository pool
$pool = new Pool;
$pool->addRepository($installedRepo);
@ -214,7 +219,7 @@ class Installer
$this->io->write('<warning>Your lock file is out of sync with your composer.json, run "composer.phar update" to update dependencies</warning>');
}
foreach ($this->locker->getLockedPackages($devMode) as $package) {
foreach ($lockedPackages as $package) {
$version = $package->getVersion();
foreach ($aliases as $alias) {
if ($alias['package'] === $package->getName() && $alias['version'] === $package->getVersion()) {

View File

@ -95,7 +95,9 @@ class Locker
if (!$package) {
$package = $this->repositoryManager->findPackage($info['package'], $info['version']);
if ($package && !empty($info['alias'])) {
$package = new AliasPackage($package, $info['alias'], $info['alias']);
$alias = new AliasPackage($package, $info['alias'], $info['alias']);
$package->getRepository()->addPackage($alias);
$package = $alias;
}
}