]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(setupchecks): Fix opcache buffer check backport/44533/stable29 45103/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 29 Apr 2024 11:56:18 +0000 (13:56 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 30 Apr 2024 08:45:13 +0000 (08:45 +0000)
This was broken by last codestyle update, maybe even before because of
 operator precedence. Now using vars to make it readable and correct at
 the same time.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/settings/lib/SetupChecks/PhpOpcacheSetup.php

index c6f5c9802ca8d459243b4be95648862ca8216323..a89916f5edbbbd667a58e203b1ae85c3406eaa20 100644 (file)
@@ -102,9 +102,11 @@ class PhpOpcacheSetup implements ISetupCheck {
                                $recommendations[] = $this->l10n->t('The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply "opcache.memory_consumption" to your PHP configuration with a value higher than "%s".', [($this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?: 'currently')]);
                        }
 
+                       $interned_strings_buffer = $this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?? 0;
+                       $memory_consumption = $this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?? 0;
                        if (
                                // Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
-                               ($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?? $this->iniGetWrapper->getNumeric('opcache.memory_consumption') > 0 ?? 0 / 4) &&
+                               ($interned_strings_buffer < ($memory_consumption / 4)) &&
                                (
                                        empty($status['interned_strings_usage']['free_memory']) ||
                                        ($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)