PluginProbe
Depicter — Popup & Slider Builder / 1.5.2
Depicter — Popup & Slider Builder v1.5.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / vendor / composer / installers / src / Composer / Installers / PxcmsInstaller.php

PxcmsInstaller.php in Depicter — Popup & Slider Builder 1.5.2, at vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php

64 lines 2.0 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 class PxcmsInstaller extends BaseInstaller
5 {
6 protected $locations = array(
7 'module' => 'app/Modules/{$name}/',
8 'theme' => 'themes/{$name}/',
9 );
10
11 /**
12 * Format package name.
13 *
14 * @param array $vars
15 *
16 * @return array
17 */
18 public function inflectPackageVars($vars)
19 {
20 if ($vars['type'] === 'pxcms-module') {
21 return $this->inflectModuleVars($vars);
22 }
23
24 if ($vars['type'] === 'pxcms-theme') {
25 return $this->inflectThemeVars($vars);
26 }
27
28 return $vars;
29 }
30
31 /**
32 * For package type pxcms-module, cut off a trailing '-plugin' if present.
33 *
34 * return string
35 */
36 protected function inflectModuleVars($vars)
37 {
38 $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
39 $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
40 $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
41 $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
42 $vars['name'] = ucwords($vars['name']); // make module name camelcased
43
44 return $vars;
45 }
46
47
48 /**
49 * For package type pxcms-module, cut off a trailing '-plugin' if present.
50 *
51 * return string
52 */
53 protected function inflectThemeVars($vars)
54 {
55 $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
56 $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
57 $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
58 $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
59 $vars['name'] = ucwords($vars['name']); // make module name camelcased
60
61 return $vars;
62 }
63 }
64