Skip to content

Commit 58e875a

Browse files
committed
Add OPcache recommendations to Transifex
Fixes: #30941 Signed-off-by: MichaIng <micha@dietpi.com>
1 parent 629bcf1 commit 58e875a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public function getFailedIntegrityCheckFiles(): DataDisplayResponse {
474474
protected function getOpcacheSetupRecommendations(): array {
475475
// If the module is not loaded, return directly to skip inapplicable checks
476476
if (!extension_loaded('Zend OPcache')) {
477-
return ['The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.'];
477+
return [$this->l10n->t('The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.')];
478478
}
479479

480480
$recommendations = [];
@@ -487,18 +487,18 @@ protected function getOpcacheSetupRecommendations(): array {
487487
}
488488

489489
if (!$this->iniGetWrapper->getBool('opcache.enable')) {
490-
$recommendations[] = 'OPcache is disabled. For better performance, it is recommended to apply <code>opcache.enable=1</code> to your PHP configuration.';
490+
$recommendations[] = $this->l10n->t('OPcache is disabled. For better performance, it is recommended to apply <code>opcache.enable=1</code> to your PHP configuration.');
491491

492492
// Check for saved comments only when OPcache is currently disabled. If it was enabled, opcache.save_comments=0 would break Nextcloud in the first place.
493493
if (!$this->iniGetWrapper->getBool('opcache.save_comments')) {
494-
$recommendations[] = 'OPcache is configured to remove code comments. With OPcache enabled, <code>opcache.save_comments=1</code> must be set for Nextcloud to function.';
494+
$recommendations[] = $this->l10n->t('OPcache is configured to remove code comments. With OPcache enabled, <code>opcache.save_comments=1</code> must be set for Nextcloud to function.');
495495
}
496496

497497
if (!$isPermitted) {
498-
$recommendations[] = 'Nextcloud is not allowed to use the OPcache API. With OPcache enabled, it is highly recommended to include all Nextcloud directories with <code>opcache.restrict_api</code> or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.';
498+
$recommendations[] = $this->l10n->t('Nextcloud is not allowed to use the OPcache API. With OPcache enabled, it is highly recommended to include all Nextcloud directories with <code>opcache.restrict_api</code> or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.');
499499
}
500500
} elseif (!$isPermitted) {
501-
$recommendations[] = 'Nextcloud is not allowed to use the OPcache API. It is highly recommended to include all Nextcloud directories with <code>opcache.restrict_api</code> or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.';
501+
$recommendations[] = $this->l10n->t('Nextcloud is not allowed to use the OPcache API. It is highly recommended to include all Nextcloud directories with <code>opcache.restrict_api</code> or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.');
502502
} else {
503503
// Check whether opcache_get_status has been explicitly disabled an in case skip usage based checks
504504
$disabledFunctions = $this->iniGetWrapper->getString('disable_functions');
@@ -513,21 +513,21 @@ protected function getOpcacheSetupRecommendations(): array {
513513
empty($status['opcache_statistics']['max_cached_keys']) ||
514514
($status['opcache_statistics']['num_cached_keys'] / $status['opcache_statistics']['max_cached_keys'] > 0.9)
515515
) {
516-
$recommendations[] = 'The maximum number of OPcache keys is nearly exceeded. To assure that all scripts can be hold in cache, it is recommended to apply <code>opcache.max_accelerated_files</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.max_accelerated_files') ?: 'currently') . '</code>.';
516+
$recommendations[] = $this->l10n->t('The maximum number of OPcache keys is nearly exceeded. To assure that all scripts can be hold in cache, it is recommended to apply <code>opcache.max_accelerated_files</code> to your PHP configuration with a value higher than <code>%s</code>.', [($this->iniGetWrapper->getNumeric('opcache.max_accelerated_files') ?: 'currently')]);
517517
}
518518

519519
if (
520520
empty($status['memory_usage']['free_memory']) ||
521521
($status['memory_usage']['used_memory'] / $status['memory_usage']['free_memory'] > 9)
522522
) {
523-
$recommendations[] = 'The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply <code>opcache.memory_consumption</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?: 'currently') . '</code>.';
523+
$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 <code>opcache.memory_consumption</code> to your PHP configuration with a value higher than <code>%s</code>.', [($this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?: 'currently')]);
524524
}
525525

526526
if (
527527
empty($status['interned_strings_usage']['free_memory']) ||
528528
($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)
529529
) {
530-
$recommendations[] = 'The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply <code>opcache.interned_strings_buffer</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?: 'currently') . '</code>.';
530+
$recommendations[] = $this->l10n->t('The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply <code>opcache.interned_strings_buffer</code> to your PHP configuration with a value higher than <code>%s</code>.', [($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?: 'currently')]);
531531
}
532532
}
533533

0 commit comments

Comments
 (0)