Skip to content

Commit e0f800c

Browse files
committed
Composer 2.0 support
1 parent c63afc7 commit e0f800c

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.0] - 2020-12-09
11+
12+
### Added
13+
- Support for Composer 2.0.
14+
1015
## [1.0.4] - 2020-10-20
1116

1217
### Changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
],
1515
"require": {
16-
"composer-plugin-api": "^1.0",
16+
"composer-plugin-api": "^1.0 || ^2.0",
1717
"hari/pw-module": "^1.0.0"
1818
},
1919
"autoload": {
@@ -22,6 +22,7 @@
2222
}
2323
},
2424
"extra": {
25-
"class": "wireframe\\ComposerInstaller\\Plugin"
25+
"class": "wireframe\\ComposerInstaller\\Plugin",
26+
"branch-version": "1.1.0"
2627
}
2728
}

src/ComposerInstaller/Plugin.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,30 @@ public static function prePackageInstall(PackageEvent $event)
6565
$installationManager->removeInstaller($moduleInstaller);
6666
}
6767
}
68+
69+
/**
70+
* Remove any hooks from Composer
71+
*
72+
* This will be called when a plugin is deactivated before being uninstalled, but also before it
73+
* gets upgraded to a new version so the old one can be deactivated and the new one activated.
74+
*
75+
* @param Composer $composer
76+
* @param IOInterface $io
77+
*/
78+
public function deactivate(Composer $composer, IOInterface $io)
79+
{
80+
}
81+
82+
/**
83+
* Prepare the plugin to be uninstalled
84+
*
85+
* This will be called after deactivate.
86+
*
87+
* @param Composer $composer
88+
* @param IOInterface $io
89+
*/
90+
public function uninstall(Composer $composer, IOInterface $io)
91+
{
92+
}
93+
6894
}

0 commit comments

Comments
 (0)