PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.0 3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 All 102 releases
payplug / vendor / composer / installers / src / Composer / Installers / DokuWikiInstaller.php

DokuWikiInstaller.php in PayPlug for WooCommerce (Official) 3.1.0, at vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php

51 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 DokuWikiInstaller extends BaseInstaller
5 {
6 protected $locations = array(
7 'plugin' => 'lib/plugins/{$name}/',
8 'template' => 'lib/tpl/{$name}/',
9 );
10
11 /**
12 * Format package name.
13 *
14 * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15 * or leading dokuwiki_ if present.
16 *
17 * For package type dokuwiki-template, cut off a trailing '-template' if present.
18 *
19 */
20 public function inflectPackageVars($vars)
21 {
22
23 if ($vars['type'] === 'dokuwiki-plugin') {
24 return $this->inflectPluginVars($vars);
25 }
26
27 if ($vars['type'] === 'dokuwiki-template') {
28 return $this->inflectTemplateVars($vars);
29 }
30
31 return $vars;
32 }
33
34 protected function inflectPluginVars($vars)
35 {
36 $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37 $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
39 return $vars;
40 }
41
42 protected function inflectTemplateVars($vars)
43 {
44 $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45 $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
47 return $vars;
48 }
49
50 }
51