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


PHP InstalledRepositoryInterface::hasPackage方法代码示例

本文整理汇总了PHP中Composer\Repository\InstalledRepositoryInterface::hasPackage方法的典型用法代码示例。如果您正苦于以下问题:PHP InstalledRepositoryInterface::hasPackage方法的具体用法?PHP InstalledRepositoryInterface::hasPackage怎么用?PHP InstalledRepositoryInterface::hasPackage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\Repository\InstalledRepositoryInterface的用法示例。


在下文中一共展示了InstalledRepositoryInterface::hasPackage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     // Debug
     $this->debug = $this->isDebug($package);
     // Composer stuff
     $this->initializeVendorDir();
     $downloadPath = $this->getInstallPath($package);
     if (!is_readable($downloadPath) && $repo->hasPackage($package)) {
         $this->removeBinaries($package);
     }
     if (!$repo->hasPackage($package)) {
         $repo->addPackage(clone $package);
     }
     $this->downloadAndExtractFile($package);
 }
开发者ID:azt3k,项目名称:non-destructive-archive-installer,代码行数:18,代码来源:NonDestructiveArchiveInstallerInstaller.php

示例2: updateCode

 public function updateCode(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
 {
     if (!$repo->hasPackage($initial)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $initial);
     }
     if ($initial->getInstallationSource() == 'source' && $initial->getSourceType() == 'git' && $target->getSourceType() == 'git') {
         $this->downloadManager->update($initial, $target, $this->getInstallPath($target));
     } else {
         $this->installCode($target);
     }
     $repo->removePackage($initial);
     if (!$repo->hasPackage($target)) {
         $repo->addPackage(clone $target);
     }
 }
开发者ID:claromentis,项目名称:installer-composer-plugin,代码行数:15,代码来源:BaseInstaller.php

示例3: isPackageInstalled

 public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($package instanceof AliasPackage) {
         return $repo->hasPackage($package) && $this->isPackageInstalled($repo, $package->getAliasOf());
     }
     return $this->getInstaller($package->getType())->isInstalled($repo, $package);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:InstallationManager.php

示例4: uninstall

 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $repo->removePackage($package);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:NoopInstaller.php

示例5: uninstall

 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         return;
     }
     $this->removeBinaries($package);
     $repo->removePackage($package);
 }
开发者ID:itscaro,项目名称:composer-global-installer,代码行数:11,代码来源:GlobalInstaller.php

示例6: uninstall

 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $repo->removePackage($package);
     $installPath = $this->getInstallPath($package);
     $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:9,代码来源:Installer.php

示例7: uninstall

 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         // TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
         return;
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $repo->removePackage($package);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:12,代码来源:NoopInstaller.php

示例8: uninstall

 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $this->removeCode($package);
     $this->removeBinaries($package);
     $repo->removePackage($package);
     $downloadPath = $this->getPackageBasePath($package);
     if (strpos($package->getName(), '/')) {
         $packageVendorDir = dirname($downloadPath);
         if (is_dir($packageVendorDir) && $this->filesystem->isDirEmpty($packageVendorDir)) {
             @rmdir($packageVendorDir);
         }
     }
 }
开发者ID:VicDeo,项目名称:poc,代码行数:16,代码来源:LibraryInstaller.php

示例9: uninstall

 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         // TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
         return;
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $downloadPath = $this->getInstallPath($package);
     $this->removeCode($package);
     $this->removeBinaries($package);
     $repo->removePackage($package);
     if (strpos($package->getName(), '/')) {
         $packageVendorDir = dirname($downloadPath);
         if (is_dir($packageVendorDir) && !glob($packageVendorDir . '/*')) {
             @rmdir($packageVendorDir);
         }
     }
 }
开发者ID:nickelc,项目名称:composer,代码行数:21,代码来源:LibraryInstaller.php

示例10: isPackageInstalled

 public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     return $repo->hasPackage($package);
 }
开发者ID:alancleaver,项目名称:composer,代码行数:4,代码来源:InstallationManagerMock.php

示例11: update

 /**
  * Updates a package
  *
  * @param \Composer\Repository\InstalledRepositoryInterface $repo
  * @param \Composer\Package\PackageInterface $initial
  * @param \Composer\Package\PackageInterface $target
  * @throws \InvalidArgumentException
  */
 public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
 {
     if (!$repo->hasPackage($initial)) {
         throw new CoreInstaller\PackageNotInstalledException($initial);
     }
     $this->getDriver()->update($initial, $target);
     $repo->removePackage($initial);
     if (!$repo->hasPackage($target)) {
         $repo->addPackage(clone $target);
     }
 }
开发者ID:netresearch,项目名称:composer-installers,代码行数:19,代码来源:CoreInstaller.php

示例12: uninstall

 /**
  * Remove symlinks for Contao sources before uninstalling a package.
  *
  * {@inheritdoc}
  *
  * @throws \InvalidArgumentException When the requested package is not installed.
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $this->logVerbose(sprintf('Removing Contao sources for %s', $package->getName()));
     $this->removeSymlinks($package, $this->getContaoRoot(), $this->getSources($package));
     parent::uninstall($repo, $package);
     $this->logVerbose('');
 }
开发者ID:contao-community-alliance,项目名称:composer-plugin,代码行数:17,代码来源:AbstractModuleInstaller.php

示例13: uninstall

 /**
  * Uninstalls specific package.
  *
  * @param \Composer\Repository\InstalledRepositoryInterface $repo repository in which to check
  * @param \Composer\Package\PackageInterface $package package instance
  */
 public function uninstall(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     if ($this->filesystem->someFilesExist($this->symlinks)) {
         $this->filesystem->removeSymlinks($this->symlinks);
     }
     $this->removeCode($package);
     $repo->removePackage($package);
 }
开发者ID:rengaw83,项目名称:CmsComposerInstallers,代码行数:17,代码来源:CoreInstaller.php

示例14: uninstall

 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE) {
         $repo->removePackage($package);
         $this->_makeBackup($repo, $package);
     } else {
         $repo->removePackage($package);
         $installPath = $this->getInstallPath($package);
         $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
     }
 }
开发者ID:staempfli,项目名称:composer-installer,代码行数:14,代码来源:Installer.php

示例15: isInstalled

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @return bool
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     // Just check if the sources folder and the link exist
     return $repo->hasPackage($package) && is_readable($this->getInstallPath($package)) && is_link($this->getPackageVendorSymlink($package));
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:11,代码来源:SharedPackageInstaller.php


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