Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Composer/Installers/TaoInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@
*/
class TaoInstaller extends BaseInstaller
{
const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';

protected $locations = array(
'extension' => '{$name}'
);

public function inflectPackageVars($vars)
{
$extra = $this->package->getExtra();

if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
$vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
return $vars;
}

$vars['name'] = str_replace('extension-', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes violate backward compatibility. May be replace this on parent::inflectPackageVars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But these manipulations are actual only for TAO extensions. I guess no need to change the default behavior in the BaseInstaller. And this installer has not been used anywhere else because we use own custom plugin, so BC definitely won't be broken.


return $vars;
}
}