File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff 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.1] - 2022-06-02
11+
12+ ### Fixed
13+ - Improved compatibility when both wireframe-framework/processwire-composer-installer and hari/pw-module are enabled.
14+
1015## [ 1.1.0] - 2020-12-09
1116
1217### Added
Original file line number Diff line number Diff line change 33namespace wireframe \ComposerInstaller ;
44
55use Composer \Composer ;
6+ use Composer \DependencyResolver \Operation \UpdateOperation ;
67use Composer \EventDispatcher \EventSubscriberInterface ;
78use Composer \IO \IOInterface ;
89use Composer \Plugin \PluginInterface ;
@@ -43,6 +44,9 @@ public static function getSubscribedEvents()
4344 PackageEvents::PRE_PACKAGE_INSTALL => [
4445 array ('prePackageInstall ' , 0 )
4546 ],
47+ PackageEvents::PRE_PACKAGE_UPDATE => [
48+ array ('prePackageInstall ' , 0 )
49+ ],
4650 ];
4751 }
4852
@@ -57,7 +61,8 @@ public static function getSubscribedEvents()
5761 */
5862 public static function prePackageInstall (PackageEvent $ event )
5963 {
60- $ package = $ event ->getOperation ()->getPackage ();
64+ $ operation = $ event ->getOperation ();
65+ $ package = $ operation instanceof UpdateOperation ? $ operation ->getTargetPackage () : $ operation ->getPackage ();
6166 if ($ package ->getType () !== 'pw-module ' ) return ;
6267 $ installationManager = $ event ->getComposer ()->getInstallationManager ();
6368 $ moduleInstaller = $ installationManager ->getInstaller ('pw-module ' );
You can’t perform that action at this time.
0 commit comments