| 1 |
<?php |
| 2 |
|
| 3 |
namespace Composer\Installers; |
| 4 |
|
| 5 |
class TastyIgniterInstaller extends BaseInstaller |
| 6 |
{ |
| 7 |
protected $locations = array( |
| 8 |
'extension' => 'extensions/{$vendor}/{$name}/', |
| 9 |
'theme' => 'themes/{$name}/', |
| 10 |
); |
| 11 |
|
| 12 |
/** |
| 13 |
* Format package name. |
| 14 |
* |
| 15 |
* Cut off leading 'ti-ext-' or 'ti-theme-' if present. |
| 16 |
* Strip vendor name of characters that is not alphanumeric or an underscore |
| 17 |
* |
| 18 |
*/ |
| 19 |
public function inflectPackageVars($vars) |
| 20 |
{ |
| 21 |
if ($vars['type'] === 'tastyigniter-extension') { |
| 22 |
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']); |
| 23 |
$vars['name'] = preg_replace('/^ti-ext-/', '', $vars['name']); |
| 24 |
} |
| 25 |
|
| 26 |
if ($vars['type'] === 'tastyigniter-theme') { |
| 27 |
$vars['name'] = preg_replace('/^ti-theme-/', '', $vars['name']); |
| 28 |
} |
| 29 |
|
| 30 |
return $vars; |
| 31 |
} |
| 32 |
} |