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


PHP Installer\LibraryInstaller類代碼示例

本文整理匯總了PHP中Composer\Installer\LibraryInstaller的典型用法代碼示例。如果您正苦於以下問題:PHP LibraryInstaller類的具體用法?PHP LibraryInstaller怎麽用?PHP LibraryInstaller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getInstallPath

 public function getInstallPath(PackageInterface $package)
 {
     $installer = new InstallerHelper($package, $this->composer, $this->io);
     $path = $installer->getInstallPath($package, $package->getType());
     // if the path is false, use the default installer path instead
     return $path !== false ? $path : LibraryInstaller::getInstallPath($package);
 }
開發者ID:oomphinc,項目名稱:composer-installers-extender,代碼行數:7,代碼來源:Installer.php

示例2: getInstallPath

 /**
  * Overridden to take into account the root package
  *
  * @see \Composer\Installer\LibraryInstaller::getInstallPath()
  */
 public function getInstallPath(PackageInterface $package)
 {
     if ($package instanceof RootPackageInterface) {
         return '.';
     }
     return parent::getInstallPath($package);
 }
開發者ID:hostnet,項目名稱:entity-plugin-lib,代碼行數:12,代碼來源:Installer.php

示例3: installCode

 /**
  * Override LibraryInstaller::installCode() to hook in additional post-download steps.
  *
  * @param PackageInterface $package Package instance
  */
 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     if (!$this->supports($package->getType())) {
         return;
     }
     $this->mirrorReleaseItems($package);
     $this->checkGitignore($package);
 }
開發者ID:loadsys,項目名稱:puphpet-release-composer-installer,代碼行數:14,代碼來源:PuphpetReleaseInstaller.php

示例4: getInstallPath

 /**
  * Determines the install path for git hooks,
  *
  * The installation path is the standard git hooks directory documented here:
  * https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
  *
  * @param PackageInterface $package
  *
  * @return string a path relative to the root of the composer.json that is being installed.
  */
 public function getInstallPath(PackageInterface $package)
 {
     if (!$this->supports($package->getType())) {
         throw new \InvalidArgumentException('Unable to install package, git-hook packages only ' . 'support "git-hook", "library" type packages.');
     }
     // Allow to LibraryInstaller to resolve the installPath for other packages.
     if ($package->getType() !== 'git-hook') {
         return parent::getInstallPath($package);
     }
     return $this->getGitHooksPath();
 }
開發者ID:bernardosilva,項目名稱:git-hooks-installer-plugin,代碼行數:21,代碼來源:Installer.php

示例5: __construct

 /**
  * @param IOInterface $io
  * @param Composer    $composer
  * @param string      $type
  * @param Filesystem  $filesystem
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $type, $filesystem);
     if ($extra = $this->composer->getPackage()->getExtra()) {
         $this->paths = isset($extra['courier-paths']) ? $extra['courier-paths'] : array();
     }
 }
開發者ID:akimsko,項目名稱:courier,代碼行數:13,代碼來源:Installer.php

示例6: getPackageBasePath

 /**
  * @param PackageInterface $package
  *
  * @return string
  */
 public function getPackageBasePath(PackageInterface $package)
 {
     $extra = $package->getExtra();
     print_r($extra);
     // get dependency glue packages
     return parent::getPackageBasePath($package);
 }
開發者ID:assertchris,項目名稱:silverstripe-composer-glue-plugin,代碼行數:12,代碼來源:GluePluginInstaller.php

示例7:

 function __construct(IOInterface $io, Composer $composer, array $installInfo)
 {
     // fill in install info defaults
     $installInfo += ['wordpress-path' => false, 'wp-content-path' => false, 'wpmu-plugin-dir' => false, 'path-mapping' => [], 'symlink-wp-content' => true, 'mu-plugin-autoloader' => true, 'dev-first' => false];
     // wp content path - either set or default
     $wpContent = $installInfo['wp-content-path'] ?: self::wp_content;
     // default paths for plugins and themes
     $installInfo['default-paths'] = ['wordpress-plugin' => "{$wpContent}/plugins", 'wordpress-muplugin' => "{$wpContent}/mu-plugins", 'wordpress-theme' => "{$wpContent}/themes"];
     // if the wp-content path was explicitly set, add to the path mapping for plugins/themes
     if ($installInfo['wp-content-path']) {
         $installInfo['path-mapping'] += $installInfo['default-paths'];
     } else {
         // set the default wp-content path for mapping and symlinking
         $installInfo['wp-content-path'] = $wpContent;
     }
     // add a mapping for core if wordpress path is set
     if ($installInfo['wordpress-path']) {
         $installInfo['path-mapping']['wordpress-core'] = $installInfo['wordpress-path'];
     } else {
         $installInfo['wordpress-path'] = $installInfo['default-paths']['wordpress-core'] = self::wordpress;
     }
     // wpmu-plugin-dir supersedes the default wp-content based path
     if ($installInfo['wpmu-plugin-dir']) {
         $installInfo['path-mapping']['wordpress-muplugin'] = $installInfo['wpmu-plugin-dir'];
     } else {
         $installInfo['wpmu-plugin-dir'] = $installInfo['default-paths']['wordpress-muplugin'];
     }
     $this->installInfo = $installInfo;
     parent::__construct($io, $composer);
 }
開發者ID:balbuf,項目名稱:composer-wp,代碼行數:30,代碼來源:WordPressInstaller.php

示例8: getInstallPath

 public function getInstallPath(PackageInterface $package)
 {
     $packageName = $package->getPrettyName();
     $packageExtra = $this->composer->getPackage()->getExtra();
     if (false === array_key_exists('wordpress-install-dir', $packageExtra)) {
         return parent::getInstallPath($package);
     }
     $installDirs = $packageExtra['wordpress-install-dir'];
     if (false === is_array($installDirs)) {
         throw new InvalidPackageException(['Installation directory must be a key value array of packages and install directories.'], [], [$installDirs]);
     }
     if (false === array_key_exists($packageName, $installDirs)) {
         throw new InvalidPackageException(['Installation directory must be a key value array of packages and install directories.'], [], [$installDirs]);
     }
     $packageInstallDir = $installDirs[$packageName];
     $installDirCount = 0;
     foreach ($installDirs as $installDir) {
         if ($installDir === $packageInstallDir) {
             $installDirCount++;
         }
     }
     if ($installDirCount > 1) {
         throw new InvalidPackageException(['Two packages cannot have the same install directory'], [], $installDirs);
     }
     return $installDirs[$packageName];
 }
開發者ID:haydenk,項目名稱:wordpress-core-installer,代碼行數:26,代碼來源:WordpressCoreInstaller.php

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

示例10: getInstallPath

 /**
  * {@inheritdoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $drupalLibraries = ['enyo/dropzone'];
     if (in_array($package->getPrettyName(), $drupalLibraries)) {
         return getcwd() . '/docroot/libraries/' . explode('/', $package->getPrettyName())[1];
     }
     return parent::getInstallPath($package);
 }
開發者ID:burdamagazinorg,項目名稱:thunder-libraries-installer,代碼行數:11,代碼來源:ThunderLibraryInstaller.php

示例11: uninstall

 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->initGingerBackend();
     $extra = $package->getExtra();
     $uninstallPluginCommand = new Cqrs\UninstallPluginCommand(array('plugin_name' => $package->getName(), 'plugin_type' => $package->getType(), 'plugin_namespace' => $extra['plugin-namespace'], 'plugin_version' => $package->getVersion()));
     $this->getServiceManager()->get('malocher.cqrs.gate')->getBus()->invokeCommand($uninstallPluginCommand);
     parent::uninstall($repo, $package);
 }
開發者ID:gingerwfms,項目名稱:ginger-plugin-installer,代碼行數:8,代碼來源:GingerInstaller.php

示例12: initializeBinDir

 protected function initializeBinDir()
 {
     parent::initializeBinDir();
     file_put_contents($this->binDir . '/composer-php', $this->generateUnixyPhpProxyCode());
     @chmod($this->binDir . '/composer-php', 0777);
     file_put_contents($this->binDir . '/composer-php.bat', $this->generateWindowsPhpProxyCode());
     @chmod($this->binDir . '/composer-php.bat', 0777);
 }
開發者ID:alancleaver,項目名稱:composer,代碼行數:8,代碼來源:PearInstaller.php

示例13: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $extra = $package->getExtra();
     if (array_key_exists("install-path", $extra)) {
         return $extra["install-path"];
     } else {
         return parent::getInstallPath($package);
     }
 }
開發者ID:khusamov-dump,項目名稱:dump,代碼行數:12,代碼來源:Installer.php

示例14: getInstallPath

 /**
  *
  * @param PackageInterface $package        	
  *
  * @return string a path relative to the root of the composer.json that is being installed.
  */
 public function getInstallPath(PackageInterface $package)
 {
     // custom install path only when it is the keeko/keeko package
     if ($this->root->getName() == 'keeko/keeko') {
         return 'packages/' . $package->getName();
     }
     // ... anyway return the default
     return parent::getInstallPath($package);
 }
開發者ID:keeko,項目名稱:composer-installer,代碼行數:15,代碼來源:KeekoComposerInstaller.php

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


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