当前位置: 首页>>代码示例>>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;未经允许,请勿转载。