From 47a0d6acc895b73812dc6e3cd1538b9c9b1355ee Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 25 Sep 2024 10:47:34 +0700 Subject: [PATCH 1/3] chore: move `composer/composer` package to framework --- extensions/package-manager/composer.json | 3 +-- framework/core/composer.json | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/package-manager/composer.json b/extensions/package-manager/composer.json index bd6ab76fda..7ab28a0411 100755 --- a/extensions/package-manager/composer.json +++ b/extensions/package-manager/composer.json @@ -22,8 +22,7 @@ "source": "https://github.com/flarum/extension-manager" }, "require": { - "flarum/core": "^2.0", - "composer/composer": "^2.7" + "flarum/core": "^2.0" }, "require-dev": { "flarum/testing": "^2.0", diff --git a/framework/core/composer.json b/framework/core/composer.json index a60bbdbd98..630cbfb279 100644 --- a/framework/core/composer.json +++ b/framework/core/composer.json @@ -37,6 +37,7 @@ }, "require": { "php": "^8.2", + "composer/composer": "^2.7", "components/font-awesome": "^6.5.2", "dflydev/fig-cookies": "^3.0", "doctrine/dbal": "^3.6", From f1b1203635b312f1f554eb8991ffd4ba015e8614 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 25 Sep 2024 13:22:55 +0700 Subject: [PATCH 2/3] chore: Bisect should use `CacheClearCommand` in core instead --- extensions/package-manager/composer.json | 3 ++- framework/core/composer.json | 1 - framework/core/src/Extension/Bisect.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/package-manager/composer.json b/extensions/package-manager/composer.json index 7ab28a0411..bd6ab76fda 100755 --- a/extensions/package-manager/composer.json +++ b/extensions/package-manager/composer.json @@ -22,7 +22,8 @@ "source": "https://github.com/flarum/extension-manager" }, "require": { - "flarum/core": "^2.0" + "flarum/core": "^2.0", + "composer/composer": "^2.7" }, "require-dev": { "flarum/testing": "^2.0", diff --git a/framework/core/composer.json b/framework/core/composer.json index 630cbfb279..a60bbdbd98 100644 --- a/framework/core/composer.json +++ b/framework/core/composer.json @@ -37,7 +37,6 @@ }, "require": { "php": "^8.2", - "composer/composer": "^2.7", "components/font-awesome": "^6.5.2", "dflydev/fig-cookies": "^3.0", "doctrine/dbal": "^3.6", diff --git a/framework/core/src/Extension/Bisect.php b/framework/core/src/Extension/Bisect.php index a817fc9296..426638af94 100644 --- a/framework/core/src/Extension/Bisect.php +++ b/framework/core/src/Extension/Bisect.php @@ -10,7 +10,7 @@ namespace Flarum\Extension; use Closure; -use Composer\Command\ClearCacheCommand; +use Flarum\Foundation\Console\CacheClearCommand; use Flarum\Settings\SettingsRepositoryInterface; use RuntimeException; use Symfony\Component\Console\Input\ArrayInput; @@ -32,7 +32,7 @@ class Bisect public function __construct( protected ExtensionManager $extensions, protected SettingsRepositoryInterface $settings, - protected ClearCacheCommand $clearCache, + protected CacheClearCommand $clearCache, ) { $this->state = BisectState::continueOrStart( $ids = $this->extensions->getEnabled(), From eeb3c7d6bf60db5c9705243f1354402d260198df Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 25 Sep 2024 13:23:46 +0700 Subject: [PATCH 3/3] chore: rename variable name --- framework/core/src/Extension/Bisect.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/core/src/Extension/Bisect.php b/framework/core/src/Extension/Bisect.php index 426638af94..77b8ce1c92 100644 --- a/framework/core/src/Extension/Bisect.php +++ b/framework/core/src/Extension/Bisect.php @@ -32,7 +32,7 @@ class Bisect public function __construct( protected ExtensionManager $extensions, protected SettingsRepositoryInterface $settings, - protected CacheClearCommand $clearCache, + protected CacheClearCommand $cacheClear, ) { $this->state = BisectState::continueOrStart( $ids = $this->extensions->getEnabled(), @@ -139,12 +139,12 @@ public function end(): void $this->settings->set('extensions_enabled', json_encode($this->state->ids)); $this->settings->set('maintenance_mode', 'none'); $this->state->end(); - $this->clearCache->run(new ArrayInput([]), new NullOutput()); + $this->cacheClear->run(new ArrayInput([]), new NullOutput()); } protected function rotateExtensions(array $enabled): void { $this->settings->set('extensions_enabled', json_encode($enabled)); - $this->clearCache->run(new ArrayInput([]), new NullOutput()); + $this->cacheClear->run(new ArrayInput([]), new NullOutput()); } }