PluginProbe
Code Snippets / 3.0.0
Code Snippets v3.0.0
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / vendor / composer / installers / src / Composer / Installers / TYPO3FlowInstaller.php

TYPO3FlowInstaller.php in Code Snippets 3.0.0, at vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php

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