From 14ed6ca2ce711ae8e8fa571a89ca30309931f757 Mon Sep 17 00:00:00 2001 From: Marco Giovinazzi Date: Mon, 26 Feb 2018 00:06:57 +0100 Subject: [PATCH 01/63] update composer reqs --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cc87f48..f4dd72a 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,10 @@ "extra": { "class": "Comodojo\\Installer\\Plugin" }, + "minimum-stability": "dev", "require": { "composer-plugin-api": "^1.0", - "comodojo/foundation": "dev-master", + "comodojo/foundation": "^1.0", "symfony/yaml": "^3.0" }, "require-dev": { From 35fdb5b8424816554d2887080de90adfd00612fe Mon Sep 17 00:00:00 2001 From: Marco Giovinazzi Date: Mon, 26 Feb 2018 00:06:57 +0100 Subject: [PATCH 02/63] update composer reqs --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cc87f48..f4dd72a 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,10 @@ "extra": { "class": "Comodojo\\Installer\\Plugin" }, + "minimum-stability": "dev", "require": { "composer-plugin-api": "^1.0", - "comodojo/foundation": "dev-master", + "comodojo/foundation": "^1.0", "symfony/yaml": "^3.0" }, "require-dev": { From 07e4ec85b7131f7b9252d949b73e4e49646d4a08 Mon Sep 17 00:00:00 2001 From: Marco Giovinazzi Date: Mon, 26 Feb 2018 00:06:57 +0100 Subject: [PATCH 03/63] update composer reqs --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 86a5698..997896e 100644 --- a/composer.json +++ b/composer.json @@ -26,10 +26,11 @@ "extra": { "class": "Comodojo\\Installer\\Plugin" }, + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "composer-plugin-api": "^1.0", - "comodojo/foundation": "dev-master", + "comodojo/foundation": "^1.0", "symfony/yaml": "^3.0" }, "require-dev": { From ea3d5c41cb938c468233334050263ae910c6d5b2 Mon Sep 17 00:00:00 2001 From: Marco Giovinazzi Date: Tue, 4 Dec 2018 00:14:13 +0100 Subject: [PATCH 04/63] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 997896e..e7052f4 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "extra": { "class": "Comodojo\\Installer\\Plugin" }, - "minimum-stability": "dev", "require": { "php": ">=5.6.0", "composer-plugin-api": "^1.0", From 199a91f1c549f57c2a152518d711395d581f1fcd Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 11:50:46 +0200 Subject: [PATCH 05/63] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e7052f4..0bd3a53 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "comodojo/comodojo-installer", + "name": "pmarcelli/comodojo-installer", "type": "composer-plugin", "license": "MIT", "description": "Modular installer for the Comodojo Project", @@ -33,7 +33,7 @@ "symfony/yaml": "^3.0" }, "require-dev": { - "composer/composer": "^1.0", + "composer/composer": "^2.1", "phpunit/phpunit": "^4.0|^5.0", "scrutinizer/ocular": "^1.0" } From 8c95af0cf50bf763f41efa97b4b8a43406492104 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:27:59 +0200 Subject: [PATCH 06/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0bd3a53..4385cb8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "require": { "php": ">=5.6.0", - "composer-plugin-api": "^1.0", + "composer-plugin-api": "^2.1", "comodojo/foundation": "^1.0", "symfony/yaml": "^3.0" }, From 65170e53f725ae39f716077d17e3c76e750a85c8 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:49:32 +0200 Subject: [PATCH 07/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index d7fb80e..187d5d6 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -33,6 +33,10 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration_persistence; + abstract public function deactivate(Composer $composer, IOInterface $io); + + abstract public function uninstall(Composer $composer, IOInterface $io); + public function activate(Composer $composer, IOInterface $io) { // First, get current extra field and init a valid installer configuration From 99229d3640d3d602372b870f96981c4ed968e17c Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:52:58 +0200 Subject: [PATCH 08/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 187d5d6..b49c2a5 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -33,9 +33,9 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration_persistence; - abstract public function deactivate(Composer $composer, IOInterface $io); + public function deactivate(Composer $composer, IOInterface $io){} - abstract public function uninstall(Composer $composer, IOInterface $io); + public function uninstall(Composer $composer, IOInterface $io){} public function activate(Composer $composer, IOInterface $io) { From d8393e5f23293350f8eb066cf7c46640ca488062 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:28:59 +0200 Subject: [PATCH 09/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4385cb8..d75fac8 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require": { "php": ">=5.6.0", "composer-plugin-api": "^2.1", - "comodojo/foundation": "^1.0", + "comodojo/foundation": "dev-foundation_u7320", "symfony/yaml": "^3.0" }, "require-dev": { From 932de81cb84667efb4b1761961e808fc95c07372 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:42:32 +0200 Subject: [PATCH 10/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d75fac8..c54e2ce 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require": { "php": ">=5.6.0", "composer-plugin-api": "^2.1", - "comodojo/foundation": "dev-foundation_u7320", + "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^3.0" }, "require-dev": { From c2b39e6d898bcc0c17c8871371f25146f56affee Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 7 Oct 2021 15:39:23 +0200 Subject: [PATCH 11/63] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c54e2ce..5ba78b5 100644 --- a/composer.json +++ b/composer.json @@ -28,12 +28,12 @@ }, "require": { "php": ">=5.6.0", - "composer-plugin-api": "^2.1", + "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^3.0" }, "require-dev": { - "composer/composer": "^2.1", + "composer/composer": "^2.0", "phpunit/phpunit": "^4.0|^5.0", "scrutinizer/ocular": "^1.0" } From 72025367e75f6589988c1b1a8296784caa158f17 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:25:20 +0200 Subject: [PATCH 12/63] Update composer.json --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5ba78b5..d986303 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "php": ">=5.6.0", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", - "symfony/yaml": "^3.0" + "symfony/yaml": "^3.0", + "react/promise": "^2.8" }, "require-dev": { "composer/composer": "^2.0", From 82e2d15a66ae1dd6c9eec504b5314f2cd54cbe50 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:32:25 +0200 Subject: [PATCH 13/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index b2ab7b2..3aee68a 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -10,6 +10,7 @@ use \Comodojo\Exception\InstallerException; use \Comodojo\Installer\Components\InstallerDriverManager; use \Comodojo\Foundation\Utils\ArrayOps; +use React\Promise\PromiseInterface; /** * @package Comodojo Framework @@ -69,9 +70,11 @@ public function supports($packageType) { */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { - parent::install($repo, $package); + $promise = parent::install($repo, $package); - $this->packageInstall($package); + $promise->done(function(){ + $this->packageInstall($package); + }); } From b8dcd8f09059fd91cb52d7ac085ef1e8d8898f64 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:51:52 +0200 Subject: [PATCH 14/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 3aee68a..302566a 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -10,7 +10,7 @@ use \Comodojo\Exception\InstallerException; use \Comodojo\Installer\Components\InstallerDriverManager; use \Comodojo\Foundation\Utils\ArrayOps; -use React\Promise\PromiseInterface; +use React\Promise\FulfilledPromise; /** * @package Comodojo Framework From 531416cfb3b5a310cf30e12ed4232ab52dc6906a Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:54:07 +0200 Subject: [PATCH 15/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 302566a..64b07f8 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -72,7 +72,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $promise->done(function(){ + $promise->then(function(){ $this->packageInstall($package); }); From b1af35cb2ab04495e464f344edc043b878d8fd55 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:57:57 +0200 Subject: [PATCH 16/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 64b07f8..7e8a64b 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -72,7 +72,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $promise->then(function(){ + $promise->done(function() use $package{ $this->packageInstall($package); }); From b2f47ec6c72f081e909c808f4db9c9a884db0889 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:59:54 +0200 Subject: [PATCH 17/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 7e8a64b..7301e63 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -72,7 +72,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $promise->done(function() use $package{ + $promise->done(function() use ($package){ $this->packageInstall($package); }); From 84ff19997eb469d04972f3c671e25a70cb092980 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:14:30 +0200 Subject: [PATCH 18/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 7301e63..bb585fb 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -10,7 +10,7 @@ use \Comodojo\Exception\InstallerException; use \Comodojo\Installer\Components\InstallerDriverManager; use \Comodojo\Foundation\Utils\ArrayOps; -use React\Promise\FulfilledPromise; +use React\Promise\PromiseInterface; /** * @package Comodojo Framework From 8456c934c848320346a7df1c08bbf82a71f39e8d Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:21:37 +0200 Subject: [PATCH 19/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index bb585fb..e86220e 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -35,6 +35,9 @@ class Installer extends LibraryInstaller { protected $supported_packages; protected $drivers = []; + + protected $io; + public function __construct( IOInterface $io, @@ -42,7 +45,8 @@ public function __construct( Configuration $configuration, InstallerConfiguration $installer_configuration ) { - + $this->io = $io; + $this->supported_packages = $installer_configuration->getPackageTypes(); $extra = $installer_configuration->getPackageExtra(); @@ -71,7 +75,9 @@ public function supports($packageType) { public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $promise = parent::install($repo, $package); - + + $this->io->write("PROMISE: " . get_class($promise)); + $promise->done(function() use ($package){ $this->packageInstall($package); }); From c762158cee3f26d2d381dc777a5988642e4ae2aa Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:29:22 +0200 Subject: [PATCH 20/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index e86220e..cd18baf 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -78,7 +78,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $this->io->write("PROMISE: " . get_class($promise)); - $promise->done(function() use ($package){ + $promise->promise()->done(function() use ($package){ $this->packageInstall($package); }); From 87e8ab4fac008b6860d0cf72d45c6620d0fcaabd Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:38:15 +0200 Subject: [PATCH 21/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index cd18baf..86c71f6 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -76,7 +76,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $this->io->write("PROMISE: " . get_class($promise)); + $this->io->write("PROMISE: " . implode("-", get_object_vars($promise))); $promise->promise()->done(function() use ($package){ $this->packageInstall($package); From df1d13135a9f65f6a9b678a140ac540ebf57f36a Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:57:23 +0200 Subject: [PATCH 22/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 86c71f6..e86220e 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -76,9 +76,9 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $this->io->write("PROMISE: " . implode("-", get_object_vars($promise))); + $this->io->write("PROMISE: " . get_class($promise)); - $promise->promise()->done(function() use ($package){ + $promise->done(function() use ($package){ $this->packageInstall($package); }); From 1f9833494933d67ba1872bb0b4e117d50e9f209c Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:07:02 +0200 Subject: [PATCH 23/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index e86220e..e9d968f 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -78,9 +78,14 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $this->io->write("PROMISE: " . get_class($promise)); + /* $promise->done(function() use ($package){ $this->packageInstall($package); }); + */ + + $this->packageInstall($package); + $this->io->write("DONE"); } From ba25e5b5fc7d16788c701a3b8cc3ddcfb7fa9212 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:15:05 +0200 Subject: [PATCH 24/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index e9d968f..e3e5fbf 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -74,18 +74,17 @@ public function supports($packageType) { */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { - $promise = parent::install($repo, $package); + $promise = parent::install($repo, $package); $this->io->write("PROMISE: " . get_class($promise)); - /* - $promise->done(function() use ($package){ + if ($promise instanceof PromiseInterface) { + $this->packageInstall($package); - }); - */ - - $this->packageInstall($package); - $this->io->write("DONE"); + $this->io->write("DONE"); + + + } } From 2e1840ad48268977fc152477885a3dc859a8f853 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:17:49 +0200 Subject: [PATCH 25/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index e3e5fbf..a2efef8 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -104,9 +104,12 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { - $this->packageUninstall($package); + $this->io->write("UNINSTALL"); - parent::uninstall($repo, $package); + $promise = parent::uninstall($repo, $package); + if ($promise instanceof PromiseInterface) { + $this->packageUninstall($package); + } } From 9f52e06f7bf496ab575a42709d5508abe64e7735 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:27:08 +0200 Subject: [PATCH 26/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index a2efef8..830d4bd 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -76,12 +76,17 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); - $this->io->write("PROMISE: " . get_class($promise)); + $this->io->write("INSTALL: " . get_class($promise)); if ($promise instanceof PromiseInterface) { - $this->packageInstall($package); - $this->io->write("DONE"); + + $promise->done(function() use($package){ + + $this->packageInstall($package); + $this->io->write("DONE"); + + }); } @@ -103,13 +108,9 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini * {@inheritDoc} */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { - - $this->io->write("UNINSTALL"); + $this->packageUninstall($package); $promise = parent::uninstall($repo, $package); - if ($promise instanceof PromiseInterface) { - $this->packageUninstall($package); - } } From 73763fad84b68339e12b446244dd0012293d9fe7 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:34:42 +0200 Subject: [PATCH 27/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 830d4bd..eda822a 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -75,7 +75,7 @@ public function supports($packageType) { public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $promise = parent::install($repo, $package); - + $this->io->write("INSTALL: " . \get_called_class()); $this->io->write("INSTALL: " . get_class($promise)); if ($promise instanceof PromiseInterface) { From bdd2d88d5b07e1ef388741893c89b974053ee8d2 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:53:05 +0200 Subject: [PATCH 28/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index eda822a..912d644 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -74,19 +74,18 @@ public function supports($packageType) { */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { - $promise = parent::install($repo, $package); - $this->io->write("INSTALL: " . \get_called_class()); + $promise = parent::install($repo, $package); $this->io->write("INSTALL: " . get_class($promise)); if ($promise instanceof PromiseInterface) { - $promise->done(function() use($package){ + //$promise->done(function() use($package){ $this->packageInstall($package); - $this->io->write("DONE"); + // $this->io->write("DONE"); - }); + //}); } From 6c1457e03c0b379ade97f2499322b43603013bee Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:55:18 +0200 Subject: [PATCH 29/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 912d644..d71528c 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -81,7 +81,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa //$promise->done(function() use($package){ - + sleep(5); $this->packageInstall($package); // $this->io->write("DONE"); From c5d8c70067ad23560e10e0e931368b78e61bc790 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:03:59 +0200 Subject: [PATCH 30/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index d71528c..e69127a 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -69,6 +69,15 @@ public function supports($packageType) { } + public function download(PackageInterface $package, PackageInterface $prevPackage = null) + { + + + $promise = parent::download($package, $prevPackage); + $this->io->write("DOWLOAD" . get_class($promise)); + } + + /** * {@inheritDoc} */ From e1335dd8f8b40c5432891ad1ea90fcb73b34f00d Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:09:10 +0200 Subject: [PATCH 31/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index e69127a..61b596d 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -86,13 +86,13 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); $this->io->write("INSTALL: " . get_class($promise)); - if ($promise instanceof PromiseInterface) { + if ($promise instanceof \React\Promise\DeferredPromise) { //$promise->done(function() use($package){ sleep(5); $this->packageInstall($package); - // $this->io->write("DONE"); + // $this->io->write(var_dump($promise)); //}); From 84c1f46bc04d5d0a94dd6ecccf02d0a8d8f31add Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:11:34 +0200 Subject: [PATCH 32/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 61b596d..da69647 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -90,9 +90,8 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa //$promise->done(function() use($package){ - sleep(5); $this->packageInstall($package); - // $this->io->write(var_dump($promise)); + $this->io->write(var_dump($promise)); //}); From ab37045bb477958e8df70554db6a37b269da824a Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:13:54 +0200 Subject: [PATCH 33/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index da69647..453b77c 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -91,7 +91,6 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa //$promise->done(function() use($package){ $this->packageInstall($package); - $this->io->write(var_dump($promise)); //}); From 9e0c122820fd0660f9c1061ce7504704728e528b Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:17:02 +0200 Subject: [PATCH 34/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 453b77c..332917c 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -86,13 +86,13 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); $this->io->write("INSTALL: " . get_class($promise)); - if ($promise instanceof \React\Promise\DeferredPromise) { + if ($promise instanceof \React\Promise\FulfilledPromise) { - //$promise->done(function() use($package){ + $promise->done(function() use($package){ $this->packageInstall($package); - //}); + }); } From b0ec8ccc21930401de7fb8a5677ec0f207c598ee Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:20:47 +0200 Subject: [PATCH 35/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 332917c..b1b206d 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -74,6 +74,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag $promise = parent::download($package, $prevPackage); + sleep(5); $this->io->write("DOWLOAD" . get_class($promise)); } @@ -86,16 +87,16 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $promise = parent::install($repo, $package); $this->io->write("INSTALL: " . get_class($promise)); - if ($promise instanceof \React\Promise\FulfilledPromise) { + //if ($promise instanceof \React\Promise\FulfilledPromise) { - $promise->done(function() use($package){ + // $promise->done(function() use($package){ $this->packageInstall($package); - }); + // }); - } + //} } From bd272f39a69f6060c512a75763d0bacdf05f4149 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:09:55 +0200 Subject: [PATCH 36/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index b1b206d..d53821e 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -72,10 +72,8 @@ public function supports($packageType) { public function download(PackageInterface $package, PackageInterface $prevPackage = null) { - $promise = parent::download($package, $prevPackage); - sleep(5); - $this->io->write("DOWLOAD" . get_class($promise)); + } From 7889099ddddd48ecce328b5280d3ae85d619f539 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:13:48 +0200 Subject: [PATCH 37/63] Update composer.json --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d986303..aa3bfeb 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ } }, "extra": { - "class": "Comodojo\\Installer\\Plugin" + "class": "Comodojo\\Installer\\Plugin", + "plugin-modifies-downloads": true }, "require": { "php": ">=5.6.0", From 1b588aaa3a61c457fdabb0c14281d6a92a2713fd Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:26:07 +0200 Subject: [PATCH 38/63] Update composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index aa3bfeb..d986303 100644 --- a/composer.json +++ b/composer.json @@ -24,8 +24,7 @@ } }, "extra": { - "class": "Comodojo\\Installer\\Plugin", - "plugin-modifies-downloads": true + "class": "Comodojo\\Installer\\Plugin" }, "require": { "php": ">=5.6.0", From 4dd28f4ca6218c1e79b9873d77531085b1612bbf Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:34:01 +0200 Subject: [PATCH 39/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index b49c2a5..2c0a7f1 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -53,17 +53,31 @@ public function activate(Composer $composer, IOInterface $io) { $this->comodojo_configuration = $this->loadComodojoConfiguration($io, $extra); // Finally, plug the installer! - $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); - $composer->getInstallationManager()->addInstaller($installer); + //$installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); + //$composer->getInstallationManager()->addInstaller($installer); } public static function getSubscribedEvents() { - return ['post-create-project-cmd' => 'startPostInstallScript']; + return [ + 'post-create-project-cmd' => 'startPostInstallScript', + 'post-install-cmd' => 'startInstaller', + 'post-update-cmd' => 'startInstaller' + ]; } + public function startInstaller($io, $composer) { + + // Finally, plug the installer! + $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); + $composer->getInstallationManager()->addInstaller($installer); + + + } + + public function startPostInstallScript(Event $event) { $script = $this->installer_configuration->getPostInstallScript(); From 10e661fcbc8e18d7affcae87b850b59ee557d4f4 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 09:56:28 +0200 Subject: [PATCH 40/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 2c0a7f1..5622d63 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -32,6 +32,8 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration; protected $comodojo_configuration_persistence; + + protected $_composer; public function deactivate(Composer $composer, IOInterface $io){} @@ -40,6 +42,8 @@ public function uninstall(Composer $composer, IOInterface $io){} public function activate(Composer $composer, IOInterface $io) { // First, get current extra field and init a valid installer configuration + $this->_composer = $composer; + $extra = $composer->getPackage()->getExtra(); $parameters = isset($extra['comodojo-installer']) && is_array($extra['comodojo-installer']) ? $extra['comodojo-installer'] : []; $this->installer_configuration = new InstallerConfiguration($parameters); @@ -68,11 +72,12 @@ public static function getSubscribedEvents() { } - public function startInstaller($io, $composer) { + public function startInstaller(Event $event) { // Finally, plug the installer! - $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); - $composer->getInstallationManager()->addInstaller($installer); + $io = $event->getIO(); + $installer = new Installer($io, $this->_composer, $this->comodojo_configuration, $this->installer_configuration); + $this->_composer->getInstallationManager()->addInstaller($installer); } From ea7c2ddcee38f0662f83170466acf4bcbff69a73 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:08:01 +0200 Subject: [PATCH 41/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 5622d63..75e0b29 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -76,6 +76,7 @@ public function startInstaller(Event $event) { // Finally, plug the installer! $io = $event->getIO(); + $io->write("START-INSTALLER"); $installer = new Installer($io, $this->_composer, $this->comodojo_configuration, $this->installer_configuration); $this->_composer->getInstallationManager()->addInstaller($installer); From d4323ff61bd15c735177d28d866c8bccb92eb913 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:16:01 +0200 Subject: [PATCH 42/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 75e0b29..4a79aa6 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -66,8 +66,7 @@ public static function getSubscribedEvents() { return [ 'post-create-project-cmd' => 'startPostInstallScript', - 'post-install-cmd' => 'startInstaller', - 'post-update-cmd' => 'startInstaller' + 'post-file-download' => 'startInstaller' ]; } From 8efd3a688859a7dc1a3c7c502df75639a45e96a3 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:19:13 +0200 Subject: [PATCH 43/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 4a79aa6..b6aff14 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -3,6 +3,7 @@ use \Composer\Composer; use \Composer\IO\IOInterface; use \Composer\Plugin\PluginInterface; +use Composer\Plugin\PostFileDownloadEvent; use \Composer\EventDispatcher\EventSubscriberInterface; use \Composer\EventDispatcher\Event; use \Comodojo\Installer\Components\InstallerConfiguration; @@ -34,6 +35,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration_persistence; protected $_composer; + protected $_io; public function deactivate(Composer $composer, IOInterface $io){} @@ -43,6 +45,7 @@ public function activate(Composer $composer, IOInterface $io) { // First, get current extra field and init a valid installer configuration $this->_composer = $composer; + $this->_io = $io; $extra = $composer->getPackage()->getExtra(); $parameters = isset($extra['comodojo-installer']) && is_array($extra['comodojo-installer']) ? $extra['comodojo-installer'] : []; @@ -71,12 +74,11 @@ public static function getSubscribedEvents() { } - public function startInstaller(Event $event) { + public function startInstaller(PostFileDownloadEvent $event) { // Finally, plug the installer! - $io = $event->getIO(); - $io->write("START-INSTALLER"); - $installer = new Installer($io, $this->_composer, $this->comodojo_configuration, $this->installer_configuration); + $this->_io->write("START-INSTALLER"); + $installer = new Installer($this->_io, $this->_composer, $this->comodojo_configuration, $this->installer_configuration); $this->_composer->getInstallationManager()->addInstaller($installer); From 54e8e2fb0db0682cf57b30bfb8550ea5bf5f94c4 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:26:10 +0200 Subject: [PATCH 44/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index b6aff14..4a7d1dc 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -69,7 +69,7 @@ public static function getSubscribedEvents() { return [ 'post-create-project-cmd' => 'startPostInstallScript', - 'post-file-download' => 'startInstaller' + 'post-file-download' => [['startInstaller',0]] ]; } From cc98eb26a271e500885c359fc7f536b1b5f6cd07 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:29:58 +0200 Subject: [PATCH 45/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 4a7d1dc..0f3c457 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -3,6 +3,7 @@ use \Composer\Composer; use \Composer\IO\IOInterface; use \Composer\Plugin\PluginInterface; +use Composer\Plugin\PluginEvents; use Composer\Plugin\PostFileDownloadEvent; use \Composer\EventDispatcher\EventSubscriberInterface; use \Composer\EventDispatcher\Event; @@ -66,11 +67,17 @@ public function activate(Composer $composer, IOInterface $io) { } public static function getSubscribedEvents() { - + /* return [ 'post-create-project-cmd' => 'startPostInstallScript', 'post-file-download' => [['startInstaller',0]] ]; + */ + return array( + PluginEvents::POST_FILE_DOWNLOAD => array( + array('startInstaller', 0) + ), + ); } From d64477208052e7431240af04b1c54702fbca71dc Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:41:07 +0200 Subject: [PATCH 46/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 0f3c457..5283442 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -35,9 +35,6 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration_persistence; - protected $_composer; - protected $_io; - public function deactivate(Composer $composer, IOInterface $io){} public function uninstall(Composer $composer, IOInterface $io){} @@ -45,9 +42,6 @@ public function uninstall(Composer $composer, IOInterface $io){} public function activate(Composer $composer, IOInterface $io) { // First, get current extra field and init a valid installer configuration - $this->_composer = $composer; - $this->_io = $io; - $extra = $composer->getPackage()->getExtra(); $parameters = isset($extra['comodojo-installer']) && is_array($extra['comodojo-installer']) ? $extra['comodojo-installer'] : []; $this->installer_configuration = new InstallerConfiguration($parameters); @@ -61,36 +55,18 @@ public function activate(Composer $composer, IOInterface $io) { $this->comodojo_configuration = $this->loadComodojoConfiguration($io, $extra); // Finally, plug the installer! - //$installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); - //$composer->getInstallationManager()->addInstaller($installer); + sleep(5); + $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); + $composer->getInstallationManager()->addInstaller($installer); } public static function getSubscribedEvents() { - /* return [ 'post-create-project-cmd' => 'startPostInstallScript', - 'post-file-download' => [['startInstaller',0]] ]; - */ - return array( - PluginEvents::POST_FILE_DOWNLOAD => array( - array('startInstaller', 0) - ), - ); - } - public function startInstaller(PostFileDownloadEvent $event) { - - // Finally, plug the installer! - $this->_io->write("START-INSTALLER"); - $installer = new Installer($this->_io, $this->_composer, $this->comodojo_configuration, $this->installer_configuration); - $this->_composer->getInstallationManager()->addInstaller($installer); - - - } - public function startPostInstallScript(Event $event) { From 6aca182f2861b0e7b971abd0b2922c6b4399797a Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:54:44 +0200 Subject: [PATCH 47/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 5283442..35725f8 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -56,8 +56,8 @@ public function activate(Composer $composer, IOInterface $io) { // Finally, plug the installer! sleep(5); - $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); - $composer->getInstallationManager()->addInstaller($installer); + $this->installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); + $composer->getInstallationManager()->addInstaller($this->installer); } From b14920f997d64b93913bf39cf9b2360661dc404c Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:17:25 +0200 Subject: [PATCH 48/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 35725f8..3519310 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -55,9 +55,8 @@ public function activate(Composer $composer, IOInterface $io) { $this->comodojo_configuration = $this->loadComodojoConfiguration($io, $extra); // Finally, plug the installer! - sleep(5); - $this->installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); - $composer->getInstallationManager()->addInstaller($this->installer); + $installer = new Installer($io, $composer, $this->comodojo_configuration, $this->installer_configuration); + $composer->getInstallationManager()->addInstaller($installer); } From 8d45f498adb00c9785ed47f02e890ecf40c204d2 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:19:05 +0200 Subject: [PATCH 49/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index d53821e..af3b2f0 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -69,32 +69,33 @@ public function supports($packageType) { } - public function download(PackageInterface $package, PackageInterface $prevPackage = null) - { - - $promise = parent::download($package, $prevPackage); - - } - + /** * {@inheritDoc} */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { - - $promise = parent::install($repo, $package); + $addPlugin = function() use ($repo, $package) { + // Add the plugin info to plugins.php + $this->packageInstall($package); + }; + + $promise = parent::install($repo, $package); $this->io->write("INSTALL: " . get_class($promise)); - //if ($promise instanceof \React\Promise\FulfilledPromise) { - + if ($promise instanceof PromiseInterface) { + return $promise->then($addPlugin); // $promise->done(function() use($package){ - $this->packageInstall($package); + //$this->packageInstall($package); // }); - //} + } + + $addPlugin(); + return null; } @@ -103,9 +104,9 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { - parent::update($repo, $initial, $target); + $promise = parent::update($repo, $initial, $target); - $this->packageUpdate($initial, $target); + $this->io->write("UPDATE: " . get_class($promise)); } From 30d0a757e1517217d5fe29c4e0d2cfba4c5a68f4 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:54:11 +0200 Subject: [PATCH 50/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index af3b2f0..8fa624f 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -106,7 +106,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini $promise = parent::update($repo, $initial, $target); - $this->io->write("UPDATE: " . get_class($promise)); + $this->io->write("UPDATE-test: " . get_class($promise)); } From 2bc156e7824dd2d64624b9f3d8e90919ed323e52 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:04:17 +0200 Subject: [PATCH 51/63] Update composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d986303..5ba78b5 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,7 @@ "php": ">=5.6.0", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", - "symfony/yaml": "^3.0", - "react/promise": "^2.8" + "symfony/yaml": "^3.0" }, "require-dev": { "composer/composer": "^2.0", From 9924268644f174368850593a9630f70123ad6ae8 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:09:42 +0200 Subject: [PATCH 52/63] Update Plugin.php --- src/Comodojo/Installer/Plugin.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Comodojo/Installer/Plugin.php b/src/Comodojo/Installer/Plugin.php index 3519310..f36fb71 100644 --- a/src/Comodojo/Installer/Plugin.php +++ b/src/Comodojo/Installer/Plugin.php @@ -3,8 +3,6 @@ use \Composer\Composer; use \Composer\IO\IOInterface; use \Composer\Plugin\PluginInterface; -use Composer\Plugin\PluginEvents; -use Composer\Plugin\PostFileDownloadEvent; use \Composer\EventDispatcher\EventSubscriberInterface; use \Composer\EventDispatcher\Event; use \Comodojo\Installer\Components\InstallerConfiguration; @@ -35,9 +33,19 @@ class Plugin implements PluginInterface, EventSubscriberInterface { protected $comodojo_configuration_persistence; - public function deactivate(Composer $composer, IOInterface $io){} + /** + * {@inheritDoc} + */ + public function deactivate(Composer $composer, IOInterface $io){ - public function uninstall(Composer $composer, IOInterface $io){} + } + + /** + * {@inheritDoc} + */ + public function uninstall(Composer $composer, IOInterface $io){ + + } public function activate(Composer $composer, IOInterface $io) { @@ -61,9 +69,9 @@ public function activate(Composer $composer, IOInterface $io) { } public static function getSubscribedEvents() { - return [ - 'post-create-project-cmd' => 'startPostInstallScript', - ]; + + return ['post-create-project-cmd' => 'startPostInstallScript']; + } From e4a9a0e3b9b54cacc4738e75da567f87edc984d7 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:25:21 +0200 Subject: [PATCH 53/63] Update Installer.php --- src/Comodojo/Installer/Installer.php | 61 +++++++++++++++++++--------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/src/Comodojo/Installer/Installer.php b/src/Comodojo/Installer/Installer.php index 8fa624f..5d283c8 100644 --- a/src/Comodojo/Installer/Installer.php +++ b/src/Comodojo/Installer/Installer.php @@ -36,16 +36,12 @@ class Installer extends LibraryInstaller { protected $drivers = []; - protected $io; - - public function __construct( IOInterface $io, Composer $composer, Configuration $configuration, InstallerConfiguration $installer_configuration ) { - $this->io = $io; $this->supported_packages = $installer_configuration->getPackageTypes(); @@ -68,33 +64,29 @@ public function supports($packageType) { return in_array($packageType, $this->supported_packages); } - - /** * {@inheritDoc} */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { - $addPlugin = function() use ($repo, $package) { - // Add the plugin info to plugins.php + + $installPackage = function() use ($package) { + $this->packageInstall($package); + }; + // Composer v2 return a promise $promise = parent::install($repo, $package); - $this->io->write("INSTALL: " . get_class($promise)); - + if ($promise instanceof PromiseInterface) { - return $promise->then($addPlugin); - // $promise->done(function() use($package){ - //$this->packageInstall($package); - - // }); - + return $promise->then($installPackage); } - $addPlugin(); + $installPackage(); + return null; } @@ -104,20 +96,51 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { + $updatePackage = function() use ($initial, $target) { + + $this->packageUpdate($initial, $target); + + }; + + // Composer v2 return a promise $promise = parent::update($repo, $initial, $target); - $this->io->write("UPDATE-test: " . get_class($promise)); + if ($promise instanceof PromiseInterface) { + + return $promise->then($updatePackage); + } + + $updatePackage(); + + return null; + } /** * {@inheritDoc} */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { - $this->packageUninstall($package); + $uninstallPackage = function() use ($package) { + + $this->packageUninstall($package); + + }; + + // Composer v2 return a promise $promise = parent::uninstall($repo, $package); + if ($promise instanceof PromiseInterface) { + + return $promise->then($uninstallPackage); + + } + + $uninstallPackage(); + + return null; + } private function packageInstall($package) { From 6be7135a872cfaf0cd66d70ba8ddede8ae08929b Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:40:54 +0200 Subject: [PATCH 54/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5ba78b5..6334f4b 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "php": ">=5.6.0", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", - "symfony/yaml": "^3.0" + "symfony/yaml": "^5.0" }, "require-dev": { "composer/composer": "^2.0", From bafe724ef8d25ffa1f0ef1731da32b15d843beb9 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 25 Oct 2021 14:51:32 +0200 Subject: [PATCH 55/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6334f4b..78e500a 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "class": "Comodojo\\Installer\\Plugin" }, "require": { - "php": ">=5.6.0", + "php": ">=^7.3", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^5.0" From de78cfc7aeb97203852d8919fadc22a4d285bd4a Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Mon, 25 Oct 2021 14:58:14 +0200 Subject: [PATCH 56/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 78e500a..237d79a 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "class": "Comodojo\\Installer\\Plugin" }, "require": { - "php": ">=^7.3", + "php": "^7.3", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^5.0" From 8f6e8d9d2ada01764ebe1c3a11ddfa282ed6a6e1 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Wed, 27 Oct 2021 15:32:09 +0200 Subject: [PATCH 57/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 237d79a..9daed46 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "php": "^7.3", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", - "symfony/yaml": "^5.0" + "symfony/yaml": ">=5.0 <=5.3" }, "require-dev": { "composer/composer": "^2.0", From 89a0bbe3130a8e9386aee92b0a536dc06f62820d Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Wed, 27 Oct 2021 15:56:47 +0200 Subject: [PATCH 58/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9daed46..2f741b0 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "php": "^7.3", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", - "symfony/yaml": ">=5.0 <=5.3" + "symfony/yaml": "^5.3" }, "require-dev": { "composer/composer": "^2.0", From 37ff809ce16330d1647b89f9c515720caadc572b Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Wed, 3 Nov 2021 10:42:44 +0100 Subject: [PATCH 59/63] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b76074f..ebfdaa7 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Modular installer for the Comodojo Project. ## Requirements -- php >= 5.6.0 -- composer-plugin-api > 1.0 +- php >= 7.3 +- composer-plugin-api >= 2.0 ## Installation From 93c3d1e914dc087357399a5dae727214e371b3d6 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:17:32 +0100 Subject: [PATCH 60/63] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ebfdaa7..b76074f 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Modular installer for the Comodojo Project. ## Requirements -- php >= 7.3 -- composer-plugin-api >= 2.0 +- php >= 5.6.0 +- composer-plugin-api > 1.0 ## Installation From dc2a35b92f0600aaa6f56b8616cbc8c64585362e Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:18:42 +0100 Subject: [PATCH 61/63] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2f741b0..bfdcb2e 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "class": "Comodojo\\Installer\\Plugin" }, "require": { - "php": "^7.3", + "php": ">=5.6.0", "composer-plugin-api": "^2.0", "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^5.3" From fd1b3261f6bcea71f0af8a3a6547f4b019b121e1 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 11 Nov 2021 15:19:58 +0100 Subject: [PATCH 62/63] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bfdcb2e..14c9fbc 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "pmarcelli/comodojo-installer", + "name": "comodojo/comodojo-installer", "type": "composer-plugin", "license": "MIT", "description": "Modular installer for the Comodojo Project", @@ -29,7 +29,7 @@ "require": { "php": ">=5.6.0", "composer-plugin-api": "^2.0", - "pmarcelli/foundation": "dev-foundation_u7320", + "comodojo/foundation": "dev-master", "symfony/yaml": "^5.3" }, "require-dev": { From b33e430313deb8bd47282ff29f82a5102ef700c6 Mon Sep 17 00:00:00 2001 From: pmacelli <91888876+pmacelli@users.noreply.github.com> Date: Thu, 18 Nov 2021 15:59:20 +0100 Subject: [PATCH 63/63] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 14c9fbc..2f741b0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "comodojo/comodojo-installer", + "name": "pmarcelli/comodojo-installer", "type": "composer-plugin", "license": "MIT", "description": "Modular installer for the Comodojo Project", @@ -27,9 +27,9 @@ "class": "Comodojo\\Installer\\Plugin" }, "require": { - "php": ">=5.6.0", + "php": "^7.3", "composer-plugin-api": "^2.0", - "comodojo/foundation": "dev-master", + "pmarcelli/foundation": "dev-foundation_u7320", "symfony/yaml": "^5.3" }, "require-dev": {