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


PHP PackageInterface::getType方法代码示例

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


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

示例1: getPackageBasePath

 protected function getPackageBasePath(PackageInterface $package)
 {
     if (!$this->supports($package->getType())) {
         throw new \InvalidArgumentException("Package type [{$type}] is not supported");
     }
     return self::$allowedTypes[$package->getType()] . '/' . $package->getPrettyName();
 }
开发者ID:kpacha,项目名称:sifo-plugin-installer,代码行数:7,代码来源:SifoInstaller.php

示例2: getRootPath

 /**
  * Returns the root installation path for templates.
  *
  * @param PackageInterface $package
  *
  * @return string a path relative to the root of the composer.json
  */
 protected function getRootPath(PackageInterface $package)
 {
     $rootPath = $this->vendorDir . '/raulfraile/ladybug-themes/Ladybug/';
     if ($this->composer->getPackage()->getName() === 'raulfraile/ladybug') {
         $rootPath = 'data/' . ($package->getType() === self::PACKAGE_TYPE_THEME ? 'themes' : 'plugins') . '/Ladybug/';
     }
     $rootPath .= $package->getType() === self::PACKAGE_TYPE_THEME ? 'Theme' : 'Plugin';
     return $rootPath;
 }
开发者ID:raulfraile,项目名称:ladybug-installer,代码行数:16,代码来源:Installer.php

示例3: getPattern

 /**
  * Retrieve the pattern for the given package.
  *
  * @param \Composer\Package\PackageInterface $package
  *
  * @return string
  */
 public function getPattern(PackageInterface $package)
 {
     if (isset($this->packages[$package->getName()])) {
         return $this->packages[$package->getName()];
     } elseif (isset($this->packages[$package->getPrettyName()])) {
         return $this->packages[$package->getPrettyName()];
     } elseif (isset($this->types[$package->getType()])) {
         return $this->types[$package->getType()];
     }
 }
开发者ID:davidbarratt,项目名称:custom-installer,代码行数:17,代码来源:Configuration.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: getPackageBasePath

 /**
  * getPackageBasePath.
  *
  * @param PackageInterface $package
  *
  * @return string
  */
 protected function getPackageBasePath(PackageInterface $package)
 {
     if (isset($this->paths[$package->getType()]) && ($path = $this->paths[$package->getType()])) {
         @(list($vendor, $name) = explode('/', $package->getPrettyName()));
         $path = strtr($path, array('{vendor}' => $vendor, '{name}' => $name));
         return rtrim($path, '/');
     }
     if (($extra = $package->getExtra()) && isset($extra['courier-path'])) {
         return rtrim($extra['courier-path'], '/');
     }
     return ($this->vendorDir ? $this->vendorDir . '/' : '') . $package->getPrettyName();
 }
开发者ID:akimsko,项目名称:courier,代码行数:19,代码来源:Installer.php

示例6: getPackageBasePath

 /**
  * {@inheritDoc}
  */
 protected function getPackageBasePath(PackageInterface $package)
 {
     $targetPath = '.faye-app';
     if ('faye-app-integration-plugin' == $package->getType()) {
         $targetPath .= '/plugins';
     }
     if ($targetPath && !file_exists($targetPath)) {
         mkdir($targetPath, 0777, true);
     }
     if ('faye-app-integration-plugin' == $package->getType()) {
         return $targetPath . '/' . str_replace('/', '-', $package->getPrettyName());
     }
     return $targetPath;
 }
开发者ID:cravler,项目名称:composer-faye-app-integration-plugin,代码行数:17,代码来源:Installer.php

示例7: getInstallPath

 /**
  * Returns the installation path of a package
  *
  * @param PackageInterface $package Package
  * 
  * @return string
  */
 public function getInstallPath(PackageInterface $package)
 {
     switch ($package->getType()) {
         case self::TYPE_WORDPRESS:
             return 'wp';
     }
 }
开发者ID:symfonypress,项目名称:installer,代码行数:14,代码来源:SymfonyPressInstaller.php

示例8: getCoreInstallPath

 protected function getCoreInstallPath(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()) {
         $extra = $this->composer->getPackage()->getExtra();
         if (!empty($extra['installer-paths'])) {
             $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type);
             if ($customPath !== false) {
                 return $this->templatePath($customPath, $availableVars);
             }
         }
     }
     $path = self::DEFAULT_TARGET_PATH;
     return $this->templatePath($path, $availableVars);
 }
开发者ID:fabian,项目名称:concrete5-composer-installers,代码行数:27,代码来源:CoreInstaller.php

示例9: getInstallPath

 /**
  * Returns the installation path of a package
  *
  * @param PackageInterface $package Package to install.
  * @return string path
  */
 public function getInstallPath(PackageInterface $package)
 {
     if ($package->getType() === $this->type) {
         return 'Packages/Applications/' . self::getPathName($package);
     }
     throw new \InvalidArgumentException('Sorry the package type of this package is not supported.');
 }
开发者ID:google-code-backups,项目名称:xinc,代码行数:13,代码来源:Installer.php

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

示例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)
 {
     $type = $package->getType();
     if ($type === 'keeko-core') {
         return 'core';
     }
     return $this->getPackageDir($type) . '/' . $package->getName();
 }
开发者ID:JasLin,项目名称:composer-installer,代码行数:14,代码来源:KeekoComposerInstaller.php

示例12: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $name = $package->getPrettyName();
     if (strpos($name, '/') !== false) {
         list($vendor, $name) = explode('/', $name);
     }
     if ($package->getType() === 'modulargaming-module') {
         return 'modulargaming/' . $name;
     }
     if ($package->getType() === 'modulargaming-theme') {
         // Remove theme- prefix if it exists.
         if (substr($name, 0, 6) === 'theme-') {
             $name = substr($name, 6);
         }
         return 'themes/' . $name;
     }
 }
开发者ID:modulargaming,项目名称:installer,代码行数:20,代码来源:ModuleInstaller.php

示例13: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $packageType = $package->getType();
     if (!isset($this->locations[$packageType])) {
         throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $packageType));
     }
     list($vendor, $name) = explode('/', strtolower($package->getName()), 2);
     $extra = $package->getExtra();
     $path = str_replace(['{$vendor}', '{$name}', '{$extra.dir}'], [$vendor, $name, $extra['dir']], $this->locations[$packageType]);
     return $this->vendorDir . '/' . $path;
 }
开发者ID:myqee,项目名称:installer,代码行数:14,代码来源:Installer.php

示例14: getInstaller

 /**
  * Returns the installer for a given type
  *
  * @param PackageInterface
  * @return AbstractPackageInstaller
  */
 private function getInstaller(PackageInterface $package)
 {
     switch ($package->getType()) {
         case 'keeko-app':
             return new AppInstaller();
         case 'keeko-module':
             return new ModuleInstaller();
         default:
             return new DummyInstaller();
     }
 }
开发者ID:keeko,项目名称:framework,代码行数:17,代码来源:DelegateInstaller.php

示例15: getPackageBasePath

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


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