| @@ 4-21 (lines=18) @@ | ||
| 1 | <?php |
|
| 2 | namespace Composer\Installers; |
|
| 3 | ||
| 4 | class AglInstaller extends BaseInstaller |
|
| 5 | { |
|
| 6 | protected $locations = array( |
|
| 7 | 'module' => 'More/{$name}/', |
|
| 8 | ); |
|
| 9 | ||
| 10 | /** |
|
| 11 | * Format package name to CamelCase |
|
| 12 | */ |
|
| 13 | public function inflectPackageVars($vars) |
|
| 14 | { |
|
| 15 | $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) { |
|
| 16 | return strtoupper($matches[1]); |
|
| 17 | }, $vars['name']); |
|
| 18 | ||
| 19 | return $vars; |
|
| 20 | } |
|
| 21 | } |
|
| 22 | ||
| @@ 9-26 (lines=18) @@ | ||
| 6 | * |
|
| 7 | * @author Jérôme Tamarelle <[email protected]> |
|
| 8 | */ |
|
| 9 | class Symfony1Installer extends BaseInstaller |
|
| 10 | { |
|
| 11 | protected $locations = array( |
|
| 12 | 'plugin' => 'plugins/{$name}/', |
|
| 13 | ); |
|
| 14 | ||
| 15 | /** |
|
| 16 | * Format package name to CamelCase |
|
| 17 | */ |
|
| 18 | public function inflectPackageVars($vars) |
|
| 19 | { |
|
| 20 | $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { |
|
| 21 | return strtoupper($matches[0][1]); |
|
| 22 | }, $vars['name']); |
|
| 23 | ||
| 24 | return $vars; |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||