| @@ 4-25 (lines=22) @@ | ||
| 1 | <?php |
|
| 2 | namespace Composer\Installers; |
|
| 3 | ||
| 4 | class HuradInstaller extends BaseInstaller |
|
| 5 | { |
|
| 6 | protected $locations = array( |
|
| 7 | 'plugin' => 'plugins/{$name}/', |
|
| 8 | 'theme' => 'plugins/{$name}/', |
|
| 9 | ); |
|
| 10 | ||
| 11 | /** |
|
| 12 | * Format package name to CamelCase |
|
| 13 | */ |
|
| 14 | public function inflectPackageVars($vars) |
|
| 15 | { |
|
| 16 | $nameParts = explode('/', $vars['name']); |
|
| 17 | foreach ($nameParts as &$value) { |
|
| 18 | $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value)); |
|
| 19 | $value = str_replace(array('-', '_'), ' ', $value); |
|
| 20 | $value = str_replace(' ', '', ucwords($value)); |
|
| 21 | } |
|
| 22 | $vars['name'] = implode('/', $nameParts); |
|
| 23 | return $vars; |
|
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| @@ 4-24 (lines=21) @@ | ||
| 1 | <?php |
|
| 2 | namespace Composer\Installers; |
|
| 3 | ||
| 4 | class RadPHPInstaller extends BaseInstaller |
|
| 5 | { |
|
| 6 | protected $locations = array( |
|
| 7 | 'bundle' => 'src/{$name}/' |
|
| 8 | ); |
|
| 9 | ||
| 10 | /** |
|
| 11 | * Format package name to CamelCase |
|
| 12 | */ |
|
| 13 | public function inflectPackageVars($vars) |
|
| 14 | { |
|
| 15 | $nameParts = explode('/', $vars['name']); |
|
| 16 | foreach ($nameParts as &$value) { |
|
| 17 | $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value)); |
|
| 18 | $value = str_replace(array('-', '_'), ' ', $value); |
|
| 19 | $value = str_replace(' ', '', ucwords($value)); |
|
| 20 | } |
|
| 21 | $vars['name'] = implode('/', $nameParts); |
|
| 22 | return $vars; |
|
| 23 | } |
|
| 24 | } |
|
| 25 | ||