PluginProbe
Code Snippets / 3.0.0
Code Snippets v3.0.0
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / vendor / composer / installers / src / Composer / Installers / DokuWikiInstaller.php

DokuWikiInstaller.php in Code Snippets 3.0.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