public function update(RepositoryInterface $repo, UpdateOperation $operation)
 {
     $this->updated[] = array($operation->getInitialPackage(), $operation->getTargetPackage());
     $this->trace[] = (string) $operation;
     $repo->removePackage($operation->getInitialPackage());
     $repo->addPackage(clone $operation->getTargetPackage());
 }
 public function update(RepositoryInterface $repo, UpdateOperation $operation)
 {
     $initial = $operation->getInitialPackage();
     $target = $operation->getTargetPackage();
     $initialType = $initial->getType();
     $targetType = $target->getType();
     if ($initialType === $targetType) {
         $installer = $this->getInstaller($initialType);
         $installer->update($repo, $initial, $target);
         $this->markForNotification($target);
     } else {
         $this->getInstaller($initialType)->uninstall($repo, $initial);
         $this->getInstaller($targetType)->install($repo, $target);
     }
 }
 /**
  * Executes update operation.
  *
  * @param   InstallOperation    $operation  operation instance
  */
 public function update(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);
     }
     $initialType = $initial->getType();
     $targetType = $target->getType();
     if ($initialType === $targetType) {
         $installer = $this->getInstaller($initialType);
         $installer->update($initial, $target);
     } else {
         $this->getInstaller($initialType)->uninstall($initial);
         $this->getInstaller($targetType)->install($target);
     }
 }
Example #4
0
 /**
  * Executes update operation.
  *
  * @param   InstallOperation    $operation  operation instance
  */
 public function update(UpdateOperation $operation)
 {
     $initial = $operation->getInitialPackage();
     $target = $operation->getTargetPackage();
     $initialType = $initial->getType();
     $targetType = $target->getType();
     if ($initialType === $targetType) {
         $installer = $this->getInstaller($initialType);
         $installer->update($initial, $target);
     } else {
         $this->getInstaller($initialType)->uninstall($initial);
         $this->getInstaller($targetType)->install($target);
     }
 }
Example #5
0
 /**
  * {@inheritDoc}
  */
 public function update(RepositoryInterface $repo, UpdateOperation $operation)
 {
     $this->packageInformation->set($this->packageInformation->escape($operation->getInitialPackage()->getPrettyName()), ['type' => 'update', 'reason' => $this->getReason($operation), 'package' => $this->dumper->dump($operation->getInitialPackage()), 'target' => $this->dumper->dump($operation->getTargetPackage())]);
     parent::update($repo, $operation);
 }