當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InstalledRepositoryInterface::removePackage方法代碼示例

本文整理匯總了PHP中Composer\Repository\InstalledRepositoryInterface::removePackage方法的典型用法代碼示例。如果您正苦於以下問題:PHP InstalledRepositoryInterface::removePackage方法的具體用法?PHP InstalledRepositoryInterface::removePackage怎麽用?PHP InstalledRepositoryInterface::removePackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Repository\InstalledRepositoryInterface的用法示例。


在下文中一共展示了InstalledRepositoryInterface::removePackage方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: update

 /**
  * {@inheritDoc}
  */
 public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $package)
 {
     if (!$repo->hasPackage($initial)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $initial);
     }
     // Debug
     $this->debug = $this->isDebug($package);
     // Composer stuff
     $this->initializeVendorDir();
     $this->removeBinaries($initial);
     $repo->removePackage($initial);
     if (!$repo->hasPackage($package)) {
         $repo->addPackage(clone $package);
     }
     $this->downloadAndExtractFile($package);
 }
開發者ID:azt3k,項目名稱:non-destructive-archive-installer,代碼行數:19,代碼來源:NonDestructiveArchiveInstallerInstaller.php

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: uninstall

 function uninstall(InstalledRepositoryInterface $repo, PackageInterface $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:balbuf,項目名稱:composer-wp,代碼行數:6,代碼來源:WordPressInstaller.php


注:本文中的Composer\Repository\InstalledRepositoryInterface::removePackage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。