Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix root aliasing and allow aliasing using the branch-alias as source

  • Loading branch information...
commit b7637b4c07fb9623318016024bd8df8c5657f455 1 parent 1d1c0fc
@Seldaek Seldaek authored committed
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/Composer/DependencyResolver/Pool.php
View
15 src/Composer/DependencyResolver/Pool.php
@@ -101,16 +101,23 @@ public function addRepository(RepositoryInterface $repo, $rootAliases = array())
}
}
- foreach (array_keys($names) as $name) {
- $this->packageByName[$name][] =& $this->packages[$id-2];
+ foreach (array_keys($names) as $provided) {
+ $this->packageByName[$provided][] =& $this->packages[$id-2];
}
// handle root package aliases
+ unset($rootAliasData);
if (isset($rootAliases[$name][$version])) {
+ $rootAliasData = $rootAliases[$name][$version];
+ } elseif (isset($package['alias_normalized']) && isset($rootAliases[$name][$package['alias_normalized']])) {
+ $rootAliasData = $rootAliases[$name][$package['alias_normalized']];
+ }
+
+ if (isset($rootAliasData)) {
$alias = $package;
unset($alias['raw']);
- $alias['version'] = $rootAliases[$name][$version]['alias_normalized'];
- $alias['alias'] = $rootAliases[$name][$version]['alias'];
+ $alias['version'] = $rootAliasData['alias_normalized'];
+ $alias['alias'] = $rootAliasData['alias'];
$alias['alias_of'] = $package['id'];
$alias['id'] = $id++;
$alias['root_alias'] = true;
Please sign in to comment.
Something went wrong with that request. Please try again.