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 / SyDESInstaller.php

SyDESInstaller.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/SyDESInstaller.php

50 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 class SyDESInstaller extends BaseInstaller
5 {
6 protected $locations = array(
7 'module' => 'app/modules/{$name}/',
8 'theme' => 'themes/{$name}/',
9 );
10
11 /**
12 * Format module name.
13 *
14 * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
15 *
16 * @param array @vars
17 *
18 * @return array
19 */
20 public function inflectPackageVars($vars)
21 {
22 if ($vars['type'] == 'sydes-module') {
23 return $this->inflectModuleVars($vars);
24 }
25
26 if ($vars['type'] === 'sydes-theme') {
27 return $this->inflectThemeVars($vars);
28 }
29
30 return $vars;
31 }
32
33 public function inflectModuleVars($vars)
34 {
35 $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
36 $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
37 $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
38
39 return $vars;
40 }
41
42 protected function inflectThemeVars($vars)
43 {
44 $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
45 $vars['name'] = strtolower($vars['name']);
46
47 return $vars;
48 }
49 }
50