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


PHP LibraryInstaller::getInstallPath方法代码示例

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


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

示例1: getInstallPath

 /**
  * Returns the installation path of a package
  *
  * @param  PackageInterface $package
  *
  * @return string
  */
 public function getInstallPath(PackageInterface $package)
 {
     if ($package->isDev()) {
         return $this->symlinkInstaller->getInstallPath($package);
     }
     return $this->defaultInstaller->getInstallPath($package);
 }
开发者ID:JasLin,项目名称:composer-shared-package-plugin,代码行数:14,代码来源:SharedPackageInstallerSolver.php

示例2: getInstallPath

 /**
  * Returns the installation path of a package
  *
  * @param  PackageInterface $package
  *
  * @return string
  */
 public function getInstallPath(PackageInterface $package)
 {
     if ($this->solver->isSharedPackage($package)) {
         return $this->symlinkInstaller->getInstallPath($package);
     }
     return $this->defaultInstaller->getInstallPath($package);
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:14,代码来源:SharedPackageInstallerSolver.php

示例3: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $type = $package->getType();
     $prettyName = $package->getPrettyName();
     if (strpos($prettyName, '/') !== false) {
         list($vendor, $name) = explode('/', $prettyName);
     } else {
         $vendor = '';
         $name = $prettyName;
     }
     $availableVars = compact('name', 'vendor', 'type');
     $extra = $package->getExtra();
     if (!empty($extra['installer-name'])) {
         $availableVars['name'] = $extra['installer-name'];
     }
     if ($this->composer->getPackage()) {
         $pkg_extra = $this->composer->getPackage()->getExtra();
         if (!empty($pkg_extra['installer-paths'])) {
             $customPath = $this->mapCustomInstallPaths($pkg_extra['installer-paths'], $prettyName, $type);
             if ($customPath !== false) {
                 return $this->templatePath($customPath, $availableVars);
             }
         }
     }
     if (empty($extra['installer-path'])) {
         return parent::getInstallPath($package);
     }
     return $this->templatePath($extra['installer-path'], $availableVars);
 }
开发者ID:soundintheory,项目名称:hooked-package-installer,代码行数:32,代码来源:HookedPackageInstaller.php

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

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

示例6: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $type = $package->getType();
     if (!$this->supports($type)) {
         throw new \InvalidArgumentException("Package type '{$type}' is not supported at this time.");
     }
     if ($type === 'projek-ci-module') {
         return parent::getInstallPath($package);
     }
     $prettyName = $package->getPrettyName();
     if (strpos($prettyName, '/') !== false) {
         list($vendor, $name) = explode('/', $prettyName);
     } else {
         $vendor = '';
         $name = $prettyName;
     }
     $extra = ($pkg = $this->composer->getPackage()) ? $pkg->getExtra() : array();
     $appdir = !empty($extra['codeigniter-application-dir']) ? $extra['codeigniter-application-dir'] : 'application';
     $install_paths = $this->package_install_paths;
     if (!empty($extra['codeigniter-module-dir'])) {
         $moduleDir = $extra['codeigniter-module-dir'];
         $install_paths['codeigniter-module'] = $moduleDir . '/{name}/';
     }
     if (!empty($extra['codeigniter-subclass-prefix'])) {
         $this->package_subclass_prefix = $extra['codeigniter-subclass-prefix'];
     }
     $vars = array('{name}' => $name, '{vendor}' => $vendor, '{type}' => $type, '{application}' => $appdir);
     return str_replace(array_keys($vars), array_values($vars), $install_paths[$type]);
 }
开发者ID:projek-xyz,项目名称:ci-installer,代码行数:32,代码来源:ComposerInstaller.php

示例7: getInstallPath

 public function getInstallPath(PackageInterface $package)
 {
     $type = $package->getType();
     if ($this->supports($type)) {
         $directory = $this->getDirectory($type, $package);
         if (!empty($directory)) {
             return $directory;
         }
     }
     $names = $package->getNames();
     if ($this->composer->getPackage()) {
         $extra = $this->composer->getPackage()->getExtra();
         if (!empty($extra['installer-paths'])) {
             foreach ($extra['installer-paths'] as $path => $packageNames) {
                 foreach ($packageNames as $packageName) {
                     if (in_array(strtolower($packageName), $names)) {
                         return $path;
                     }
                 }
             }
         }
     }
     /*
      * In case, the user didn't provide a custom path
      * use the default one, by calling the parent::getInstallPath function
      */
     return parent::getInstallPath($package);
 }
开发者ID:speedwork,项目名称:installer,代码行数:28,代码来源:LibraryInstaller.php

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

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

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

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

示例12: getInstallPath

 public function getInstallPath(PackageInterface $package)
 {
     $strDest = parent::getInstallPath($package);
     $parts = explode('_', $package->getName());
     if ('qcubed/plugin' === $parts[0]) {
         $strDest = ($this->vendorDir ? $this->vendorDir . '/' : '') . 'qcubed/plugin/' . $parts[1];
     }
     return $strDest;
 }
开发者ID:spekary,项目名称:composer,代码行数:9,代码来源:Installer.php

示例13: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     if (empty($this->drupalLibraryMap[$package->getPrettyName()])) {
         $path = parent::getInstallPath($package);
     } else {
         $path = $this->drupalLibrariesPath . $this->drupalLibraryMap[$package->getPrettyName()];
     }
     return $path;
 }
开发者ID:promet,项目名称:drupal-libraries-installer-plugin,代码行数:12,代码来源:DrupalLibraryInstaller.php

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

示例15: getInstallPath

 /**
  * {@inheritdoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     switch ($package->getType()) {
         case self::TYPE_MOODLE_SOURCE:
             $basePath = $this->getMoodleDir();
             break;
         default:
             $basePath = parent::getInstallPath($package);
     }
     return $basePath;
 }
开发者ID:covex-nn,项目名称:moodle-installer,代码行数:14,代码来源:MoodleInstaller.php


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