本文整理汇总了PHP中Composer\Installer\LibraryInstaller::update方法的典型用法代码示例。如果您正苦于以下问题:PHP LibraryInstaller::update方法的具体用法?PHP LibraryInstaller::update怎么用?PHP LibraryInstaller::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Installer\LibraryInstaller
的用法示例。
在下文中一共展示了LibraryInstaller::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* {@inheritdoc}
*/
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $package)
{
if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
return;
}
parent::update($repo, $initial, $package);
}
示例2: update
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);
}
示例3: update
/**
* @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);
}
示例4: update
/**
* {@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);
}
示例5: update
/**
* {@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);
}
}
示例6: update
/**
* {@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);
}
示例7: update
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);
}
示例8: update
/**
* @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();
}
}
示例9: update
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);
}
示例10: update
/**
* 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);
}
}
示例11: update
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);
}
}
示例12: update
/**
* 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']);
}
}
}
示例13: update
/**
* {@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);
}
}
示例14: update
/**
* {@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);
}
}
示例15: update
/**
* {@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));
}
}