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'] = ucfirst(preg_replace('/-module/', '', $vars['name']));
39 protected function inflectThemeVars($vars)
41 $vars['name'] = ucfirst(preg_replace('/-theme$/', '', $vars['name']));