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