| 1 |
<?php |
| 2 |
namespace Composer\Installers; |
| 3 |
|
| 4 |
/** |
| 5 |
* Class PiwikInstaller |
| 6 |
* |
| 7 |
* @package Composer\Installers |
| 8 |
*/ |
| 9 |
class PiwikInstaller extends BaseInstaller |
| 10 |
{ |
| 11 |
/** |
| 12 |
* @var array |
| 13 |
*/ |
| 14 |
protected $locations = array( |
| 15 |
'plugin' => 'plugins/{$name}/', |
| 16 |
); |
| 17 |
|
| 18 |
/** |
| 19 |
* Format package name to CamelCase |
| 20 |
* @param array $vars |
| 21 |
* |
| 22 |
* @return array |
| 23 |
*/ |
| 24 |
public function inflectPackageVars($vars) |
| 25 |
{ |
| 26 |
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); |
| 27 |
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); |
| 28 |
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); |
| 29 |
|
| 30 |
return $vars; |
| 31 |
} |
| 32 |
} |
| 33 |
|