當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。