当前位置: 首页>>代码示例>>PHP>>正文


PHP LibraryInstaller::update方法代码示例

本文整理汇总了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);
 }
开发者ID:spress,项目名称:spress-installer,代码行数:10,代码来源:Installer.php

示例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);
 }
开发者ID:lionjsa,项目名称:barberry-plugin-installer,代码行数:7,代码来源:ComposerInstaller.php

示例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);
 }
开发者ID:fraym,项目名称:composer-installers,代码行数:12,代码来源:ExtensionInstaller.php

示例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);
 }
开发者ID:Flesh192,项目名称:magento,代码行数:12,代码来源:PluginInstaller.php

示例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);
     }
 }
开发者ID:comodojo,项目名称:comodojo-installer,代码行数:12,代码来源:Installer.php

示例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);
 }
开发者ID:natxet,项目名称:composer,代码行数:12,代码来源:InstallerInstaller.php

示例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);
 }
开发者ID:CoreTyson,项目名称:plugin-installer,代码行数:9,代码来源:Installer.php

示例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();
     }
 }
开发者ID:selenzo,项目名称:bsuir,代码行数:13,代码来源:Installer.php

示例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);
 }
开发者ID:gingerwfms,项目名称:ginger-plugin-installer,代码行数:11,代码来源:GingerInstaller.php

示例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);
     }
 }
开发者ID:JasLin,项目名称:composer-shared-package-plugin,代码行数:29,代码来源:SharedPackageInstallerSolver.php

示例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);
     }
 }
开发者ID:fiild,项目名称:installer,代码行数:15,代码来源:Installer.php

示例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']);
         }
     }
 }
开发者ID:DaGhostman,项目名称:pxb-composer,代码行数:24,代码来源:ModuleInstaller.php

示例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);
     }
 }
开发者ID:oligriffiths,项目名称:nooku-installer,代码行数:19,代码来源:JoomlaExtension.php

示例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);
     }
 }
开发者ID:vStone,项目名称:plugin-installer,代码行数:20,代码来源:PluginInstaller.php

示例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));
     }
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:18,代码来源:SharedPackageInstaller.php


注:本文中的Composer\Installer\LibraryInstaller::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。