blob: 42572f44f56ad08108f39ec42976082918fa4b3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<?php
namespace Composer\Installers;
/**
* An installer to handle TYPO3 Flow specifics when installing packages.
*/
class TYPO3FlowInstaller extends BaseInstaller
{
protected $locations = array(
'package' => 'Packages/Application/{$name}/',
'framework' => 'Packages/Framework/{$name}/',
'plugin' => 'Packages/Plugins/{$name}/',
'site' => 'Packages/Sites/{$name}/',
'boilerplate' => 'Packages/Boilerplates/{$name}/',
'build' => 'Build/{$name}/',
);
/**
* Modify the package name to be a TYPO3 Flow style key.
*
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
$autoload = $this->package->getAutoload();
if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
$namespace = key($autoload['psr-0']);
$vars['name'] = str_replace('\\', '.', $namespace);
}
if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
$namespace = key($autoload['psr-4']);
$vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
}
return $vars;
}
}
|