From 8897e886cb98c1371377931e7bb2942b34266bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 Apr 2024 11:36:51 +0200 Subject: [PATCH 1/2] Test using Roundcubemail from Packagist --- composer.json | 6 ------ test-composer/composer.json | 7 ++----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index f08d7df..ce412a2 100644 --- a/composer.json +++ b/composer.json @@ -31,12 +31,6 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.3" }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/roundcube/roundcubemail.git" - } - ], "minimum-stability": "dev", "prefer-stable": true, "autoload": { diff --git a/test-composer/composer.json b/test-composer/composer.json index cd3533a..d3e8bbe 100644 --- a/test-composer/composer.json +++ b/test-composer/composer.json @@ -1,13 +1,10 @@ { "name": "roundcube/plugin-installer-test", "require": { - "roundcube/carddav": "^4 || ^5" + "roundcube/carddav": "^4 || ^5", + "roundcube/roundcubemail": "dev-master as 1.99" }, "repositories": [ - { - "type": "git", - "url": "https://github.com/roundcube/roundcubemail.git" - }, { "type": "path", "url": ".." From 331e0791b333575cf2b09fc0a8914135f6003e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 21 Apr 2024 01:31:01 +0200 Subject: [PATCH 2/2] Include RC iniset.php using async promise --- src/ExtensionInstaller.php | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/ExtensionInstaller.php b/src/ExtensionInstaller.php index 8cfbd61..5d0ca1a 100644 --- a/src/ExtensionInstaller.php +++ b/src/ExtensionInstaller.php @@ -73,10 +73,11 @@ private function initializeRoundcubemailEnvironment(): void public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->setRoundcubemailInstallPath($repo); - $this->initializeRoundcubemailEnvironment(); - $this->rcubeVersionCheck($package); $postInstall = function () use ($package) { + $this->initializeRoundcubemailEnvironment(); + $this->rcubeVersionCheck($package); + $config_file = $this->rcubeConfigFile(); $package_name = $this->getPackageName($package); $package_dir = $this->getInstallPath($package); @@ -134,20 +135,21 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { $this->setRoundcubemailInstallPath($repo); - $this->initializeRoundcubemailEnvironment(); - $this->rcubeVersionCheck($target); - $extra = $target->getExtra(); - $fs = new Filesystem(); + $postUpdate = function () use ($initial, $target) { + $this->initializeRoundcubemailEnvironment(); + $this->rcubeVersionCheck($target); + + $extra = $target->getExtra(); + $fs = new Filesystem(); - // backup persistent files e.g. config.inc.php - $package_dir = $this->getInstallPath($initial); - $temp_dir = $package_dir . '-' . sprintf('%010d%010d', mt_rand(), mt_rand()); + // backup persistent files e.g. config.inc.php + $package_dir = $this->getInstallPath($initial); + $temp_dir = $package_dir . '-' . sprintf('%010d%010d', mt_rand(), mt_rand()); - // make a backup of existing files (for restoring persistent files) - $fs->copy($package_dir, $temp_dir); + // make a backup of existing files (for restoring persistent files) + $fs->copy($package_dir, $temp_dir); - $postUpdate = function () use ($target, $extra, $fs, $temp_dir) { $package_name = $this->getPackageName($target); $package_dir = $this->getInstallPath($target); @@ -199,11 +201,12 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->setRoundcubemailInstallPath($repo); - $this->initializeRoundcubemailEnvironment(); - $config = $this->composer->getConfig()->get('roundcube'); + $postUninstall = function () use ($package) { + $this->initializeRoundcubemailEnvironment(); + + $config = $this->composer->getConfig()->get('roundcube'); - $postUninstall = function () use ($package, $config) { // post-uninstall: deactivate package $package_name = $this->getPackageName($package); $package_dir = $this->getInstallPath($package);