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


PHP PackageInterface::getPrettyName方法代碼示例

本文整理匯總了PHP中Composer\Package\PackageInterface::getPrettyName方法的典型用法代碼示例。如果您正苦於以下問題:PHP PackageInterface::getPrettyName方法的具體用法?PHP PackageInterface::getPrettyName怎麽用?PHP PackageInterface::getPrettyName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Package\PackageInterface的用法示例。


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

示例1: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     if (substr($package->getPrettyName(), 0, 23) != 'phpdocumentor/template-') {
         throw new \InvalidArgumentException('Unable to install template, phpdocumentor templates should always start their package name with "phpdocumentor/template."');
     }
     return 'data/templates/' . substr($package->getPrettyName(), 23);
 }
開發者ID:CobaltBlueDW,項目名稱:oddsandends,代碼行數:10,代碼來源:UnifiedAssetInstaller.php

示例2: getInstallPath

 /**
  * {@inheritdoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 18);
     if ('societycms/module-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install module, societycms modules ' . 'should always start their package name with ' . '"societycms/module-"');
     }
     return 'modules/' . ucfirst(substr($package->getPrettyName(), 18));
 }
開發者ID:SocietyCMS,項目名稱:composer-installer-plugin,代碼行數:11,代碼來源:ModuleInstaller.php

示例3: getPackageBasePath

 /**
  * {@inheritDoc}
  */
 public function getPackageBasePath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 9);
     if ('ckeditor/' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install template, CKEditor Plugin templates ' . 'should always start their package name with ' . '"ckeditor/"');
     }
     return 'vendor/ckeditor/ckeditor/' . substr($package->getPrettyName(), 9);
 }
開發者ID:albertvolkman,項目名稱:ckeditor-composer-installer,代碼行數:11,代碼來源:TemplateInstaller.php

示例4: assertBarberryPlugin

 private static function assertBarberryPlugin(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 16);
     if ('barberry/plugin-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install plugin, barberry plugins ' . 'should always start their package name with ' . '"barberry/plugin-"');
     }
     return ucfirst(substr($package->getPrettyName(), 16));
 }
開發者ID:lionjsa,項目名稱:barberry-plugin-installer,代碼行數:8,代碼來源:ComposerInstaller.php

示例5: getInstallPath

 /**
  * {@inheritDoc}
  **/
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 18);
     if ('canvashack/plugin-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install plugin, CanvasHack plugins should always start their package name with "canvashack/plugin-"');
     }
     return 'hacks/' . substr($package->getPrettyName(), 18);
 }
開發者ID:smtech,項目名稱:canvashack-installer,代碼行數:11,代碼來源:CanvasHackInstaller.php

示例6: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 14);
     if ('zepluf/plugin-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install plugin ' . $package->getPrettyName() . ', ZePLUF plugin package names  should always begin with "zepluf/plugin-"');
     }
     return 'app/plugins/' . $package->getTargetDir();
 }
開發者ID:zepluf,項目名稱:installer,代碼行數:11,代碼來源:PluginInstaller.php

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

示例8: getPackageBasePath

 /**
  * {@inheritDoc}
  */
 public function getPackageBasePath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 24);
     if ('phpdocumentor/template1-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install template, phpdocumentor templates ' . 'should always start their package name with ' . '"phpdocumentor/template-"');
     }
     return 'data/templates/' . substr($package->getPrettyName(), 24);
 }
開發者ID:hongmizhijia,項目名稱:kang,代碼行數:11,代碼來源:TemplateInstaller.php

示例9: getPackageBasePath

 public function getPackageBasePath(PackageInterface $package)
 {
     if (strpos($package->getPrettyName(), '/simpleid-') === false) {
         throw new \InvalidArgumentException('SimpleID modules have package names containing simpleid-');
     }
     $subdir = substr($package->getPrettyName(), strpos($package->getPrettyName(), '/simpleid-') + 10);
     return 'site/' . $subdir;
 }
開發者ID:simpleid,項目名稱:module-installer,代碼行數:8,代碼來源:ModuleInstaller.php

示例10: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $parts = explode('/', $package->getPrettyName());
     if (count($parts) !== 2) {
         throw new \InvalidArgumentException('The package name is incorrect for ' . $package->getPrettyName());
     }
     return 'modules/' . $parts[0] . '/' . $parts['1'];
 }
開發者ID:hechoenlaravel,項目名稱:composer-plugin,代碼行數:11,代碼來源:ModuleInstaller.php

示例11: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 17);
     if ('getherbie/plugin-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install herbie plugin. The package name should always start with "getherbie/plugin-"');
     }
     $basePath = 'site/plugins/' . substr($package->getPrettyName(), 17);
     return $basePath;
 }
開發者ID:getherbie,項目名稱:composer,代碼行數:12,代碼來源:Installer.php

示例12: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $needed_prefix = 'factorial-io/';
     $prefix = substr($package->getPrettyName(), 0, strlen($needed_prefix));
     if ($needed_prefix !== $prefix) {
         throw new \InvalidArgumentException('Unable to install factorial-tool. It' . 'should always start its package name with ' . '"' . $needed_prefix . '"');
     }
     return '_tools/' . substr($package->getPrettyName(), strlen($needed_prefix));
 }
開發者ID:factorial-io,項目名稱:factorial-tools-installer-plugin,代碼行數:12,代碼來源:ToolsInstaller.php

示例13: getInstallPath

 /**
  * @inheritdoc
  */
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 11);
     var_dump($prefix);
     if ('kickou/yii2-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install template, phpdocumentor templates ' . 'should always start their package name with ' . '"kickou/yii2-"');
     }
     return 'modules/' . substr($package->getPrettyName(), 11);
 }
開發者ID:kickou,項目名稱:yii2-module-installer,代碼行數:12,代碼來源:ModuleInstaller.php

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

示例15: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $strip = 'myadmin/template-';
     $cut = strlen($strip) - 1;
     $prefix = substr($package->getPrettyName(), 0, $cut);
     if ($strip !== $prefix) {
         throw new \InvalidArgumentException("Unable to install template, myadmin templates should always start their package name with '{$strip}'");
     }
     return 'public_html/templates/' . substr($package->getPrettyName(), $cut);
 }
開發者ID:detain,項目名稱:myadmin_composer_plugin,代碼行數:13,代碼來源:TemplateInstaller.php


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