PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.0.21
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.0.21
1.2.74 1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 All 174 releases
userswp / vendor / composer / installers / src / Composer / Installers / ShopwareInstaller.php

ShopwareInstaller.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.0.21, at vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php

61 lines 1.6 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 * Plugin/theme installer for shopware
6 * @author Benjamin Boit
7 */
8 class ShopwareInstaller extends BaseInstaller
9 {
10 protected $locations = array(
11 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14 'theme' => 'templates/{$name}/',
15 'plugin' => 'custom/plugins/{$name}/',
16 'frontend-theme' => 'themes/Frontend/{$name}/',
17 );
18
19 /**
20 * Transforms the names
21 * @param array $vars
22 * @return array
23 */
24 public function inflectPackageVars($vars)
25 {
26 if ($vars['type'] === 'shopware-theme') {
27 return $this->correctThemeName($vars);
28 }
29
30 return $this->correctPluginName($vars);
31 }
32
33 /**
34 * Changes the name to a camelcased combination of vendor and name
35 * @param array $vars
36 * @return array
37 */
38 private function correctPluginName($vars)
39 {
40 $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
41 return strtoupper($matches[0][1]);
42 }, $vars['name']);
43
44 $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
45
46 return $vars;
47 }
48
49 /**
50 * Changes the name to a underscore separated name
51 * @param array $vars
52 * @return array
53 */
54 private function correctThemeName($vars)
55 {
56 $vars['name'] = str_replace('-', '_', $vars['name']);
57
58 return $vars;
59 }
60 }
61