From 39f052407adae530e425df1d85c29be513da5f5e Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:43:20 +0200 Subject: [PATCH 1/3] fix(setupchecks): Skip checking for OPcache if running from CLI Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/settings/lib/SetupChecks/PhpOpcacheSetup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php index e3cf4659dbef8..254c4155df821 100644 --- a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php +++ b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php @@ -114,6 +114,11 @@ protected function getOpcacheSetupRecommendations(): array { } public function run(): SetupResult { + // Skip OPcache checks if running from CLI + if (PHP_SAPI === 'cli') { + return SetupResult::success($this->l10n->t('Checking from CLI, OPcache checks have been skipped.')); + } + [$level,$recommendations] = $this->getOpcacheSetupRecommendations(); if (!empty($recommendations)) { return match($level) { From 372c9d2ee6e3bcc9c5e19d97390c14a2ea7ace1a Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:09:29 +0200 Subject: [PATCH 2/3] fix: check both CLI and value Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/settings/lib/SetupChecks/PhpOpcacheSetup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php index 254c4155df821..35422078c8273 100644 --- a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php +++ b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php @@ -115,7 +115,7 @@ protected function getOpcacheSetupRecommendations(): array { public function run(): SetupResult { // Skip OPcache checks if running from CLI - if (PHP_SAPI === 'cli') { + if (OC::$CLI && !$this->iniGetWrapper->getBool('opcache.enable_cli')) { return SetupResult::success($this->l10n->t('Checking from CLI, OPcache checks have been skipped.')); } From fa84f52c3fbaa40a746b91266f79cc279302f165 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:11:35 +0200 Subject: [PATCH 3/3] fix: typo Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/settings/lib/SetupChecks/PhpOpcacheSetup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php index 35422078c8273..22605012058b1 100644 --- a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php +++ b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php @@ -115,7 +115,7 @@ protected function getOpcacheSetupRecommendations(): array { public function run(): SetupResult { // Skip OPcache checks if running from CLI - if (OC::$CLI && !$this->iniGetWrapper->getBool('opcache.enable_cli')) { + if (\OC::$CLI && !$this->iniGetWrapper->getBool('opcache.enable_cli')) { return SetupResult::success($this->l10n->t('Checking from CLI, OPcache checks have been skipped.')); }