Make sure the anti-aliased package contains the alias info from the correct alias
parent
cc3d91f75c
commit
903facd64f
|
@ -127,11 +127,7 @@ class InstallationManager
|
|||
*/
|
||||
public function install(RepositoryInterface $repo, InstallOperation $operation)
|
||||
{
|
||||
$package = $operation->getPackage();
|
||||
if ($package instanceof AliasPackage) {
|
||||
$package = $package->getAliasOf();
|
||||
$package->setInstalledAsAlias(true);
|
||||
}
|
||||
$package = $this->antiAlias($operation->getPackage());
|
||||
$installer = $this->getInstaller($package->getType());
|
||||
$installer->install($repo, $package);
|
||||
$this->notifyInstall($package);
|
||||
|
@ -145,15 +141,8 @@ class InstallationManager
|
|||
*/
|
||||
public function update(RepositoryInterface $repo, UpdateOperation $operation)
|
||||
{
|
||||
$initial = $operation->getInitialPackage();
|
||||
if ($initial instanceof AliasPackage) {
|
||||
$initial = $initial->getAliasOf();
|
||||
}
|
||||
$target = $operation->getTargetPackage();
|
||||
if ($target instanceof AliasPackage) {
|
||||
$target = $target->getAliasOf();
|
||||
$target->setInstalledAsAlias(true);
|
||||
}
|
||||
$initial = $this->antiAlias($operation->getInitialPackage());
|
||||
$target = $this->antiAlias($operation->getTargetPackage());
|
||||
|
||||
$initialType = $initial->getType();
|
||||
$targetType = $target->getType();
|
||||
|
@ -176,10 +165,7 @@ class InstallationManager
|
|||
*/
|
||||
public function uninstall(RepositoryInterface $repo, UninstallOperation $operation)
|
||||
{
|
||||
$package = $operation->getPackage();
|
||||
if ($package instanceof AliasPackage) {
|
||||
$package = $package->getAliasOf();
|
||||
}
|
||||
$package = $this->antiAlias($operation->getPackage());
|
||||
$installer = $this->getInstaller($package->getType());
|
||||
$installer->uninstall($repo, $package);
|
||||
}
|
||||
|
@ -217,4 +203,17 @@ class InstallationManager
|
|||
$package->getRepository()->notifyInstall($package);
|
||||
}
|
||||
}
|
||||
|
||||
private function antiAlias(PackageInterface $package)
|
||||
{
|
||||
if ($package instanceof AliasPackage) {
|
||||
$alias = $package;
|
||||
$package = $package->getAliasOf();
|
||||
$package->setInstalledAsAlias(true);
|
||||
$package->setAlias($alias->getVersion());
|
||||
$package->setPrettyAlias($alias->getPrettyVersion());
|
||||
}
|
||||
|
||||
return $package;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue