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


PHP InstalledRepositoryInterface::addPackage方法代码示例

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


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

示例1: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->installCode($package);
     if (!$repo->hasPackage($package)) {
         $repo->addPackage(clone $package);
     }
 }
开发者ID:claromentis,项目名称:installer-composer-plugin,代码行数:10,代码来源:ModuleInstallerV7.php

示例2: install

 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->initializeVendorDir();
     $downloadPath = $this->getInstallPath($package);
     // remove the binaries if it appears the package files are missing
     if (!is_readable($downloadPath) && $repo->hasPackage($package)) {
         $this->binaryInstaller->removeBinaries($package);
     }
     // Save .modman folder temporally to recover it after the source code is installed.
     if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE && is_dir($downloadPath . '/.modman')) {
         $this->filesystem->copyThenRemove($downloadPath . '/.modman', $this->tmpModmanBackup);
     }
     $this->installCode($package);
     $this->binaryInstaller->installBinaries($package, $this->vendorDir);
     if (!$repo->hasPackage($package)) {
         $repo->addPackage(clone $package);
     }
     if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE) {
         // remove git
         $this->filesystem->removeDirectory($downloadPath . '/.git');
         // Recover modman temporal backup after the magento source installation
         if (is_dir($this->tmpModmanBackup)) {
             $this->filesystem->copyThenRemove($this->tmpModmanBackup, $downloadPath . '/.modman');
         }
         // copy .modman directory from backup dir when exist
         if (is_dir($this->backupPath . '/.modman')) {
             $this->filesystem->copyThenRemove($this->backupPath . '/.modman', $downloadPath . '/.modman');
         }
     }
 }
开发者ID:staempfli,项目名称:composer-installer,代码行数:30,代码来源:Installer.php

示例3: update

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

示例4: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->installCode($package);
     if (!$repo->hasPackage($package)) {
         $repo->addPackage(clone $package);
     }
     $this->filesystem->ensureDirectoryExists('data');
     $this->filesystem->ensureDirectoryExists('local_data');
 }
开发者ID:claromentis,项目名称:installer-composer-plugin,代码行数:12,代码来源:FrameworkInstaller.php

示例5: update

 public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
 {
     if (!$repo->hasPackage($initial)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $initial);
     }
     $this->initializeVendorDir();
     $this->removeBinaries($initial);
     $this->updateCode($initial, $target);
     $this->installBinaries($target);
     $repo->removePackage($initial);
     if (!$repo->hasPackage($target)) {
         $repo->addPackage(clone $target);
     }
 }
开发者ID:VicDeo,项目名称:poc,代码行数:14,代码来源:LibraryInstaller.php

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

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

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

示例9: update

 /**
  * Updates specific package.
  *
  * @param \Composer\Repository\InstalledRepositoryInterface $repo repository in which to check
  * @param \Composer\Package\PackageInterface $initial already installed package version
  * @param \Composer\Package\PackageInterface $target updated version
  */
 public function update(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $initial, \Composer\Package\PackageInterface $target)
 {
     $this->getTypo3OrgService->addDistToPackage($initial);
     $this->getTypo3OrgService->addDistToPackage($target);
     if ($this->filesystem->someFilesExist($this->symlinks)) {
         $this->filesystem->removeSymlinks($this->symlinks);
     }
     $this->updateCode($initial, $target);
     $this->filesystem->establishSymlinks($this->symlinks);
     $repo->removePackage($initial);
     if (!$repo->hasPackage($target)) {
         $repo->addPackage(clone $target);
     }
 }
开发者ID:rengaw83,项目名称:CmsComposerInstallers,代码行数:21,代码来源:CoreInstaller.php


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