Skip to content

Commit

Permalink
fix(setupchecks): Fix opcache buffer check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
come-nc committed Apr 29, 2024
1 parent f708240 commit 3d6f773
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ protected function getOpcacheSetupRecommendations(): array {
$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)
Expand Down

0 comments on commit 3d6f773

Please sign in to comment.