/** * Updates specific package * * @param InstalledRepositoryInterface $repo repository in which to check * @param PackageInterface $initial already installed package version * @param PackageInterface $target updated version * * @throws InvalidArgumentException if $from package is not installed */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if ($target->getType() === 'magento-core' && !$this->preUpdateMagentoCore()) { return; } // cleanup marshaled files if extra->map exist if ($this->hasExtraMap($initial)) { $initialStrategy = $this->getDeployStrategy($initial); $initialStrategy->setMappings($this->getParser($initial)->getMappings()); try { $initialStrategy->clean(); } catch (\ErrorException $e) { if ($this->io->isDebug()) { $this->io->write($e->getMessage()); } } } parent::update($repo, $initial, $target); // marshal files for new package version if extra->map exist if ($this->hasExtraMap($target)) { $targetStrategy = $this->getDeployStrategy($target); $targetStrategy->setMappings($this->getParser($target)->getMappings()); $deployManagerEntry = new Entry(); $deployManagerEntry->setPackageName($target->getName()); $deployManagerEntry->setDeployStrategy($targetStrategy); $this->deployManager->addPackage($deployManagerEntry); } if ($this->appendGitIgnore) { $this->appendGitIgnore($target, $this->getGitIgnoreFileLocation()); } if ($target->getType() === 'magento-core') { $this->postUpdateMagentoCore(); } }
/** * Updates specific package * * @param InstalledRepositoryInterface $repo repository in which to check * @param PackageInterface $initial already installed package version * @param PackageInterface $target updated version * * @throws InvalidArgumentException if $from package is not installed */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if ($target->getType() === 'magento-core' && !$this->preUpdateMagentoCore()) { return; } $initialStrategy = $this->getDeployStrategy($initial); $initialStrategy->setMappings($this->getParser($initial)->getMappings()); $initialStrategy->clean(); parent::update($repo, $initial, $target); $targetStrategy = $this->getDeployStrategy($target); $targetStrategy->setMappings($this->getParser($target)->getMappings()); $deployManagerEntry = new Entry(); $deployManagerEntry->setPackageName($target->getName()); $deployManagerEntry->setDeployStrategy($targetStrategy); $this->deployManager->addPackage($deployManagerEntry); if ($this->appendGitIgnore) { $this->appendGitIgnore($target, $this->getGitIgnoreFileLocation()); } if ($target->getType() === 'magento-core') { $this->postUpdateMagentoCore(); } }
/** * Updates specific package * * @param InstalledRepositoryInterface $repo repository in which to check * @param PackageInterface $initial already installed package version * @param PackageInterface $target updated version * * @throws InvalidArgumentException if $from package is not installed */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $initialStrategy = $this->getDeployStrategy($initial); $initialStrategy->setMappings($this->getParser($initial)->getMappings()); $initialStrategy->clean(); parent::update($repo, $initial, $target); $targetStrategy = $this->getDeployStrategy($target); $targetStrategy->setMappings($this->getParser($target)->getMappings()); $deployManagerEntry = new Entry(); $deployManagerEntry->setPackageName($target->getName()); $deployManagerEntry->setDeployStrategy($targetStrategy); $this->deployManager->addPackage($deployManagerEntry); }