Skip to content

Commit a29d998

Browse files
Merge pull request #319 from ChristianMoll/plentymarkets_installer
plentymarkets custom installer
2 parents 236a390 + b985936 commit a29d998

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ is not needed to install packages with these frameworks:
7777
| Piwik | `piwik-plugin`
7878
| phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
7979
| Pimcore | `pimcore-plugin`
80+
| Plentymarkets | `plentymarkets-plugin`
8081
| PPI | **`ppi-module`**
8182
| Puppet | `puppet-module`
8283
| RadPHP | `radphp-bundle`

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"Moodle",
4141
"Piwik",
4242
"phpBB",
43+
"Plentymarkets",
4344
"PPI",
4445
"Puppet",
4546
"RadPHP",

src/Composer/Installers/Installer.php

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class Installer extends LibraryInstaller
6060
'phpbb' => 'PhpBBInstaller',
6161
'pimcore' => 'PimcoreInstaller',
6262
'piwik' => 'PiwikInstaller',
63+
'plentymarkets'=> 'PlentymarketsInstaller',
6364
'ppi' => 'PPIInstaller',
6465
'puppet' => 'PuppetInstaller',
6566
'radphp' => 'RadPHPInstaller',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
namespace Composer\Installers;
3+
4+
class PlentymarketsInstaller extends BaseInstaller
5+
{
6+
protected $locations = array(
7+
'plugin' => '{$name}/'
8+
);
9+
10+
/**
11+
* Remove hyphen, "plugin" and format to camelcase
12+
* @param array $vars
13+
*
14+
* @return array
15+
*/
16+
public function inflectPackageVars($vars)
17+
{
18+
$vars['name'] = explode("-", $vars['name']);
19+
foreach ($vars['name'] as $key => $name) {
20+
$vars['name'][$key] = ucfirst($vars['name'][$key]);
21+
if (strcasecmp($name, "Plugin") == 0) {
22+
unset($vars['name'][$key]);
23+
}
24+
}
25+
$vars['name'] = implode("",$vars['name']);
26+
27+
return $vars;
28+
}
29+
}

tests/Composer/Installers/Test/InstallerTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function dataForTestSupport()
153153
array('piwik-plugin', true),
154154
array('phpbb-extension', true),
155155
array('pimcore-plugin', true),
156+
array('plentymarkets-plugin', true),
156157
array('ppi-module', true),
157158
array('prestashop-module', true),
158159
array('prestashop-theme', true),
@@ -298,6 +299,7 @@ public function dataForTestInstallPath()
298299
array('phpbb-style', 'styles/foo/', 'test/foo'),
299300
array('phpbb-language', 'language/foo/', 'test/foo'),
300301
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
302+
array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
301303
array('ppi-module', 'modules/foo/', 'test/foo'),
302304
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
303305
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),

0 commit comments

Comments
 (0)