diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-29 13:56:18 +0200 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-05-06 18:02:57 +0200 |
commit | 253167626a6471120fa9e04d2bdbf96ccab1da7c (patch) | |
tree | a4d524b267c595f28d881d0bdee22a1afa9a8390 /apps | |
parent | 7c6ba41b82f1da414b672519ec7eb5fc4d7a2bd3 (diff) | |
download | nextcloud-server-253167626a6471120fa9e04d2bdbf96ccab1da7c.tar.gz nextcloud-server-253167626a6471120fa9e04d2bdbf96ccab1da7c.zip |
fix(setupchecks): Fix opcache buffer check
This was broken 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>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/SetupChecks/PhpOpcacheSetup.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php index 07e4b513497..a89916f5edb 100644 --- a/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php +++ b/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php @@ -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') ?? 0 < $this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?? 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) |