Skip to content

Commit 8669edf

Browse files
authored
Update TAO Installer for proper work (#437)
It adds additional manipulations with name to fit naming template.
1 parent b93bcf0 commit 8669edf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Composer/Installers/TaoInstaller.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,25 @@
66
*/
77
class TaoInstaller extends BaseInstaller
88
{
9+
const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';
10+
911
protected $locations = array(
1012
'extension' => '{$name}'
1113
);
14+
15+
public function inflectPackageVars($vars)
16+
{
17+
$extra = $this->package->getExtra();
18+
19+
if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
20+
$vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
21+
return $vars;
22+
}
23+
24+
$vars['name'] = str_replace('extension-', '', $vars['name']);
25+
$vars['name'] = str_replace('-', ' ', $vars['name']);
26+
$vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
27+
28+
return $vars;
29+
}
1230
}

0 commit comments

Comments
 (0)