| 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 |
|