PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.63
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.63
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 / OctoberInstaller.php

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

49 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 OctoberInstaller extends BaseInstaller
5 {
6 protected $locations = array(
7 'module' => 'modules/{$name}/',
8 'plugin' => 'plugins/{$vendor}/{$name}/',
9 'theme' => 'themes/{$vendor}-{$name}/'
10 );
11
12 /**
13 * Format package name.
14 *
15 * For package type october-plugin, cut off a trailing '-plugin' if present.
16 *
17 * For package type october-theme, cut off a trailing '-theme' if present.
18 *
19 */
20 public function inflectPackageVars($vars)
21 {
22 if ($vars['type'] === 'october-plugin') {
23 return $this->inflectPluginVars($vars);
24 }
25
26 if ($vars['type'] === 'october-theme') {
27 return $this->inflectThemeVars($vars);
28 }
29
30 return $vars;
31 }
32
33 protected function inflectPluginVars($vars)
34 {
35 $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
36 $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
37
38 return $vars;
39 }
40
41 protected function inflectThemeVars($vars)
42 {
43 $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
44 $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
45
46 return $vars;
47 }
48 }
49