Skip to content

Commit

Permalink
Merge pull request #12 from suzymasri/composer2x-upgrade
Browse files Browse the repository at this point in the history
Composer 2.x support
  • Loading branch information
davidbarratt authored Dec 11, 2020
2 parents 9000911 + ef81077 commit b7300b3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
language: php
php:
- "5.5"
- "5.4"
- "5.3"
- "7.3"

matrix:
- COMPOSER_CHANNEL=1
- COMPOSER_CHANNEL=2

before_install:
- composer self-update
- composer self-update "--${COMPOSER_CHANNEL}"

install:
- composer install --no-interaction --prefer-source

script:
- ./vendor/bin/phpcs .
- ./vendor/bin/phpunit
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"class": "DavidBarratt\\CustomInstaller\\CustomInstallerPlugin"
},
"require": {
"composer-plugin-api": "~1.0"
"composer-plugin-api": "~1 || ~2"
},
"require-dev": {
"composer/composer": "~1.0@dev",
"composer/composer": "~1.0@dev || ~2.0@dev",
"phpunit/phpunit": "~4.1",
"squizlabs/php_codesniffer": "~2.5"
}
Expand Down
2 changes: 0 additions & 2 deletions src/CustomInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function getInstallPath(PackageInterface $package)
} else {
return parent::getInstallPath($package);
}

}

/**
Expand Down Expand Up @@ -67,7 +66,6 @@ protected function getPackageReplacementTokens(PackageInterface $package)
$pieces = explode('/', $prettyName);
$vars['{$vendor}'] = $pieces[0];
$vars['{$name}'] = $pieces[1];

} else {
$vars['{$vendor}'] = '';
$vars['{$name}'] = $prettyName;
Expand Down
8 changes: 8 additions & 0 deletions src/CustomInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ public function activate(Composer $composer, IOInterface $io)
$installer = new CustomInstaller($io, $composer);
$composer->getInstallationManager()->addInstaller($installer);
}

public function deactivate(Composer $composer, IOInterface $io)
{
}

public function uninstall(Composer $composer, IOInterface $io)
{
}
}

0 comments on commit b7300b3

Please sign in to comment.