Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
koubas committed Jun 5, 2013
0 parents commit aaff151
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
composer.phar
nbproject
._*
.~lock.*
.buildpath
.DS_Store
.idea
.project
.settings
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "koubas/grouped-library-installer",
"type": "composer-installer",
"authors": [
{
"name": "Jakub Husak",
"email": "[email protected]"
}
],
"autoload": {
"psr-0": {"Koubas\\Composer\\Installer": "src/"}
},
"extra": {
"class": "Koubas\\Composer\\Installer\\GroupedLibraryInstaller"
}
}
Binary file added composer.phar
Binary file not shown.
33 changes: 33 additions & 0 deletions src/Koubas/Composer/Installer/GroupedLibraryInstaller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Koubas\Composer\Installer;


use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Installer\LibraryInstaller;
use Composer\Package\PackageInterface;

class GroupedLibraryInstaller extends LibraryInstaller
{
public function __construct(IOInterface $io, Composer $composer, $type = 'library')
{
parent::__construct($io, $composer, $type);
}

public function getInstallPath(PackageInterface $package)
{
$pkgNameParts = explode('/', $package->getName());
$words = explode('-', end($pkgNameParts));
$dirName = '';
foreach ($words as $word) {
$dirName .= ucfirst($word);
}
return "module/$dirName";
}

public function supports($packageType)
{
return 'koubas-grouped-library' === $packageType;
}
}

0 comments on commit aaff151

Please sign in to comment.