本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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));
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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'];
}
示例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;
}
示例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));
}
示例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);
}
示例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()];
}
}
示例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);
}