Skip to content

Commit

Permalink
Merge pull request #3 from greg-1-anderson/composer-2
Browse files Browse the repository at this point in the history
Composer 2 support.
  • Loading branch information
rvtraveller authored Jan 4, 2021
2 parents 20d6f43 + a0e63cd commit 3d25d4a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"class": "rvtraveller\\QuicksilverComposerInstaller\\QuicksilverComposerInstallerPlugin"
},
"require": {
"composer-plugin-api": "~1.0",
"composer/installers": "~1.0"
"composer-plugin-api": "^1.0 || ^2.0",
"composer/installers": "^1.9"
},
"require-dev": {
"composer/composer": "~1.0@dev"
"composer/composer": "1.0.* || 2.0.*@dev"
}
}
15 changes: 13 additions & 2 deletions src/QuicksilverComposerInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@

class QuicksilverComposerInstallerPlugin implements PluginInterface
{
private $installer;

public function activate(Composer $composer, IOInterface $io)
{
// Strange autoloading problem on CircleCI
if (!class_exists(QuickSilverComposerInstaller::class)) {
include_once __DIR__ . '/QuicksilverComposerInstaller.php';
}
$installer = new QuickSilverComposerInstaller($io, $composer);
$composer->getInstallationManager()->addInstaller($installer);
$this->installer = new QuickSilverComposerInstaller($io, $composer);
$composer->getInstallationManager()->addInstaller($this->installer);
}

public function deactivate(Composer $composer, IOInterface $io)
{
$composer->getInstallationManager()->removeInstaller($this->installer);
}

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

0 comments on commit 3d25d4a

Please sign in to comment.