Skip to content

Commit

Permalink
Support for MediaWiki extensions. Fixes GH-37.
Browse files Browse the repository at this point in the history
  • Loading branch information
hashar authored and shama committed Sep 19, 2012
1 parent eae5f43 commit 43dd8ed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package type.
* Lithium `lithium-`
* Magento `magento-`
* Mako `mako-`
* MediaWiki `mediawiki-`
* phpBB `phpbb-`
* PPI `ppi-`
* SilverStripe `silverstripe-`
Expand Down Expand Up @@ -88,7 +89,9 @@ So submit your packages to [packagist.org](http://packagist.org)!
* magento-skin
* magento-theme
* Mako
* mako-package
* mako-package
* MediaWiki
* mediawiki-extension
* phpBB
* phpbb-extension
* PPI
Expand Down
1 change: 1 addition & 0 deletions src/Composer/Installers/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Installer extends LibraryInstaller
'lithium' => 'LithiumInstaller',
'magento' => 'MagentoInstaller',
'mako' => 'MakoInstaller',
'mediawiki' => 'MediaWikiInstaller',
'phpbb' => 'PhpBBInstaller',
'ppi' => 'PPIInstaller',
'silverstripe' => 'SilverStripeInstaller',
Expand Down
21 changes: 21 additions & 0 deletions src/Composer/Installers/MediaWikiInstaller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
namespace Composer\Installers;

class MediaWikiInstaller extends BaseInstaller
{
protected $locations = array(
'extension' => 'extensions/{$name}/',
);

/**
* Format package name to CamelCase keeping existing uppercase chars.
*/
public function inflectPackageVars($vars)
{
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));

return $vars;
}

}
4 changes: 4 additions & 0 deletions tests/Composer/Installers/Test/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function dataForTestSupport()
array('lithium-library', true),
array('magento-library', true),
array('mako-package', true),
array('mediawiki-extension', true),
array('phpbb-extension', true),
array('ppi-module', true),
array('silverstripe-module', true),
Expand Down Expand Up @@ -140,6 +141,9 @@ public function dataForTestInstallPath()
array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
array('magento-library', 'lib/foo/', 'test/foo'),
array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
array('mediawiki-extension', 'extensions/APC/', 'author/APC' ),
array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard' ),
array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi' ),
array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
array('ppi-module', 'modules/foo/', 'test/foo'),
array('silverstripe-module', 'my_module/', 'shama/my_module'),
Expand Down

0 comments on commit 43dd8ed

Please sign in to comment.