2 namespace Composer\Installers;
4 class AsgardInstaller extends BaseInstaller
6 protected $locations = array(
7 'module' => 'Modules/{$name}/',
8 'theme' => 'Themes/{$name}/'
12 * Format package name.
14 * For package type asgard-module, cut off a trailing '-plugin' if present.
16 * For package type asgard-theme, cut off a trailing '-theme' if present.
19 public function inflectPackageVars($vars)
21 if ($vars['type'] === 'asgard-module') {
22 return $this->inflectPluginVars($vars);
25 if ($vars['type'] === 'asgard-theme') {
26 return $this->inflectThemeVars($vars);
32 protected function inflectPluginVars($vars)
34 $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
35 $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36 $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
41 protected function inflectThemeVars($vars)
43 $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44 $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45 $vars['name'] = str_replace(' ', '', ucwords($vars['name']));