當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。