2 namespace Composer\Installers;
4 class DokuWikiInstaller extends BaseInstaller
6 protected $locations = array(
7 'plugin' => 'lib/plugins/{$name}/',
8 'template' => 'lib/tpl/{$name}/',
12 * Format package name.
14 * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15 * or leading dokuwiki_ if present.
17 * For package type dokuwiki-template, cut off a trailing '-template' if present.
20 public function inflectPackageVars($vars)
23 if ($vars['type'] === 'dokuwiki-plugin') {
24 return $this->inflectPluginVars($vars);
27 if ($vars['type'] === 'dokuwiki-template') {
28 return $this->inflectTemplateVars($vars);
34 protected function inflectPluginVars($vars)
36 $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37 $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
42 protected function inflectTemplateVars($vars)
44 $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45 $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);