/** * {@inheritdoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $package) { if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) { return; } parent::update($repo, $initial, $package); }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $pluginName = self::assertBarberryPlugin($target); parent::update($repo, $initial, $target); $this->registerAutoloader($target); $this->installPlugin($target, $pluginName); }
/** * @param InstalledRepositoryInterface $repo * @param PackageInterface $initial * @param PackageInterface $target */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $path = $this->getInstallPath($initial); $this->removeExtension($path, $initial); $this->addExtension($path, $target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $extra = $target->getExtra(); if (empty($extra['class'])) { throw new \UnexpectedValueException('Error while installing ' . $target->getPrettyName() . ', composer-plugin packages should have a class defined in their extra key to be usable.'); } parent::update($repo, $initial, $target); $this->composer->getPluginManager()->registerPackage($target, true); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); if (is_null($this->package_installer)) { $this->io->write('<error>PackageInstaller not ready or missing configuration: package could not be installed.</error>'); } else { $this->packageUpdate($initial, $target); } }
/** * {@inheritDoc} */ public function update(PackageInterface $initial, PackageInterface $target) { $extra = $target->getExtra(); if (empty($extra['class'])) { throw new \UnexpectedValueException('Error while installing ' . $target->getPrettyName() . ', composer-installer packages should have a class defined in their extra key to be usable.'); } parent::update($initial, $target); $this->registerInstaller($target); }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $ns = static::primaryNamespace($initial); $this->updateConfig($ns, null); $path = $this->getInstallPath($target); $ns = $this->primaryNamespace($target); $this->updateConfig($ns, $path); }
/** * @inheritdoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->removePackage($initial); $this->addPackage($target); // ensure the yii2-dev package also provides Yii.php in the same place as yii2 does if ($initial->getName() == 'yiisoft/yii2-dev') { $this->linkBaseYiiFiles(); } }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->initGingerBackend(); $newExtra = $target->getExtra(); if (!isset($newExtra['plugin-namespace'])) { throw new Exception\RuntimeException(sprintf('Missing the key -plugin-namespace- in the -extra- property of the new plugin -%s- composer.json.', $target->getName())); } parent::update($repo, $initial, $target); $pluginUpdatedEvent = new Cqrs\PluginUpdatedEvent(array('plugin_name' => $initial->getName(), 'plugin_type' => $initial->getType(), 'plugin_namespace' => $newExtra['plugin-namespace'], 'old_plugin_version' => $initial->getVersion(), 'new_plugin_version' => $target->getVersion())); $this->getServiceManager()->get('malocher.cqrs.gate')->getBus()->publishEvent($pluginUpdatedEvent); }
/** * Behaviors : * * New (version replacement, Stable to Dev or Dev to Stable) : * - Stable : > vendor directory * - Dev : > shared dependencies directory * * Update (if package name & target directory are the same) : * - Stable : checkout new sources * - Dev : checkout new sources * * In case of replacement (see "New" part above) : * - The old package is completely deleted ("composer remove" process) before installing the new version * * * {@inheritdoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { // If both packages are stable version (tag) if (!$target->isDev() && !$initial->isDev()) { $this->defaultInstaller->update($repo, $initial, $target); } else { if (!$repo->hasPackage($initial)) { throw new \InvalidArgumentException('Package is not installed : ' . $initial->getPrettyName()); } $this->symlinkInstaller->update($repo, $initial, $target); } }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); if ($this->shouldInstallAssets($target)) { $assetsPath = $this->getAssetsPath($target); $package_name = $target->getPrettyName(); if ($this->shouldCreateAssetsDest($package_name)) { if (!$this->createAssetsDest($package_name)) { throw new \Exception('Could not create assets destination.'); } } $this->installCssAssets($assetsPath, $package_name); // $this->installJavaScriptAssets($assetsPath, $package_name); } }
/** * 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 $initial package is not installed */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->io->write('<info> ** Checking for changes in configuration file entry</info>'); $oldExtra = $initial->getExtra(); $targetExtra = $target->getExtra(); parent::update($repo, $initial, $target); if (array_key_exists('pxb-config', $targetExtra) && array_key_exists('pxb-config', $oldExtra)) { if ($oldExtra['pxb-config'] === $targetExtra['pxb-config']) { $this->io->write('<info> ** No changes</info>'); } else { $this->io->write('<info> Attempting to upgrade...</info>'); $this->updateModule($target, $oldExtra['pxb-config'], $targetExtra['pxb-config']); } } }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$this->_isValidName($target->getPrettyName())) { throw new \InvalidArgumentException('Invalid package name `' . $target->getPrettyName() . '`. ' . 'Name should be of the format `vendor/xyz_name`, where xyz is a valid Joomla extension type (' . implode(', ', $this->_package_prefixes) . ').'); } parent::update($repo, $initial, $target); if (!$this->_application->update($this->getInstallPath($target))) { // Get all error messages that were stored in the message queue $descriptions = $this->_getApplicationMessages(); $error = 'Error while updating ' . $target->getPrettyName(); if (count($descriptions)) { $error .= ':' . PHP_EOL . implode(PHP_EOL, $descriptions); } throw new \RuntimeException($error); } }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->rcubeVersionCheck($target); parent::update($repo, $initial, $target); $extra = $target->getExtra(); // trigger updatedb.sh if (!empty($extra['roundcube']['sql-dir'])) { $plugin_name = $this->getPluginName($target); if ($sqldir = realpath($this->getVendorDir() . "/{$plugin_name}/" . $extra['roundcube']['sql-dir'])) { system(getcwd() . "/bin/updatedb.sh --package={$plugin_name} --dir={$sqldir}", $res); } } // run post-update script if (!empty($extra['roundcube']['post-update-script'])) { $this->rcubeRunScript($extra['roundcube']['post-update-script'], $target); } }
/** * {@inheritdoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->packageDataManager->setPackageInstallationSource($initial); $this->packageDataManager->setPackageInstallationSource($target); // The package need only a code update because the version (branch), only the commit changed if ($this->getInstallPath($initial) === $this->getInstallPath($target)) { $this->createPackageVendorSymlink($target); parent::update($repo, $initial, $target); } else { // If the initial package sources folder exists, uninstall it $this->composer->getInstallationManager()->uninstall($repo, new UninstallOperation($initial)); // Install the target package $this->composer->getInstallationManager()->install($repo, new InstallOperation($target)); } }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { echo "update"; parent::update($repo, $initial, $target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->initializeGlobalDir(); parent::update($repo, $initial, $target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->removeAssets($initial); parent::update($repo, $initial, $target); $this->installAssets($target); }
/** * 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) { $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); }
public final function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->cleanup($target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->removeCommandsFromPackage($initial); $this->addCommandsFromPackage($target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->queue[] = $package; }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->applyPatch($target); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->uninstallEntryFiles($initial); parent::update($repo, $initial, $target); $this->installEntryFiles($target); }
/** * @param InstalledRepositoryInterface $repo * @param PackageInterface $initial * @param PackageInterface $target * * @throws \Kisma\Core\Exceptions\FileSystemException */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { Log::info('Update package "' . $initial->getPrettyName() . ' ' . $initial->getVersion()); $this->_validatePackage($target); $this->_unlinkPlugIn(); parent::update($repo, $initial, $target); $this->_linkPlugIn(); }
/** * @depends testInstallerCreationShouldNotCreateVendorDirectory * @depends testInstallerCreationShouldNotCreateBinDirectory */ public function testUpdate() { $library = new LibraryInstaller($this->vendorDir, $this->binDir, $this->dm, $this->repository, $this->io); $initial = $this->createPackageMock(); $target = $this->createPackageMock(); $initial->expects($this->once())->method('getPrettyName')->will($this->returnValue('package1')); $this->repository->expects($this->exactly(3))->method('hasPackage')->will($this->onConsecutiveCalls(true, false, false)); $this->dm->expects($this->once())->method('update')->with($initial, $target, $this->vendorDir . '/package1'); $this->repository->expects($this->once())->method('removePackage')->with($initial); $this->repository->expects($this->once())->method('addPackage')->with($target); $library->update($initial, $target); $this->assertFileExists($this->vendorDir, 'Vendor dir should be created'); $this->assertFileExists($this->binDir, 'Bin dir should be created'); $this->setExpectedException('InvalidArgumentException'); $library->update($initial, $target); }
/** * Remove symlinks for Contao sources before update, then add them again afterwards. * * {@inheritdoc} * * @throws \InvalidArgumentException When the requested package is not installed. */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$repo->hasPackage($initial)) { throw new \InvalidArgumentException('Package is not installed: ' . $initial); } $this->logVerbose(sprintf('Updating Contao sources for %s', $initial->getName())); $contaoRoot = $this->getContaoRoot(); $this->removeSymlinks($initial, $contaoRoot, $this->getSources($initial)); parent::update($repo, $initial, $target); $this->addSymlinks($target, $contaoRoot, $this->getSources($target)); $this->addCopies($target, $this->getFilesRoot(), $this->getUserFiles($target), self::DUPLICATE_IGNORE); $this->addRunonces($target, $this->getRunonces($target)); $this->logVerbose(''); }
/** * {@inheritDoc} */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { parent::update($repo, $initial, $target); $this->createSaltSeed(); $this->createWpConfig(); }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->io->write("xpressengine-installer: updating " . $target->getName()); if ($this->checkDevPlugin($initial)) { $this->io->write("xpressengine-installer: skip to update " . $initial->getName()); // throw exception!! return; } parent::update($repo, $initial, $target); static::$changed['updated'][$target->getName()] = $target->getPrettyVersion(); }