You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the module is not loaded, return directly to skip inapplicable checks
56
58
if (!extension_loaded('Zend OPcache')) {
57
-
return [$this->l10n->t('The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.')];
59
+
return ['error',[$this->l10n->t('The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.')]];
58
60
}
59
61
60
62
$recommendations = [];
61
63
62
64
// Check whether Nextcloud is allowed to use the OPcache API
if ($permittedPath !== '' && !str_starts_with(\OC::$SERVERROOT, rtrim($permittedPath, '/'))) {
66
68
$isPermitted = false;
67
69
}
68
70
69
71
if (!$this->iniGetWrapper->getBool('opcache.enable')) {
70
72
$recommendations[] = $this->l10n->t('OPcache is disabled. For better performance, it is recommended to apply "opcache.enable=1" to your PHP configuration.');
71
-
72
-
// 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.
73
-
if (!$this->iniGetWrapper->getBool('opcache.save_comments')) {
74
-
$recommendations[] = $this->l10n->t('OPcache is configured to remove code comments. With OPcache enabled, "opcache.save_comments=1" must be set for Nextcloud to function.');
75
-
}
76
-
77
-
if (!$isPermitted) {
78
-
$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 "opcache.restrict_api" or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.');
79
-
}
80
-
} elseif (!$isPermitted) {
81
-
$recommendations[] = $this->l10n->t('Nextcloud is not allowed to use the OPcache API. It is highly recommended to include all Nextcloud directories with "opcache.restrict_api" or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.');
$recommendations[] = $this->l10n->t('The shared memory based OPcache is disabled. For better performance, it is recommended to apply "opcache.file_cache_only=0" to your PHP configuration and use the file cache as second level cache only.');
84
76
} else {
85
77
// Check whether opcache_get_status has been explicitly disabled an in case skip usage based checks
@@ -117,16 +114,33 @@ protected function getOpcacheSetupRecommendations(): array {
117
114
}
118
115
}
119
116
120
-
return$recommendations;
117
+
// 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.
118
+
if (!$this->iniGetWrapper->getBool('opcache.save_comments')) {
119
+
$recommendations[] = $this->l10n->t('OPcache is configured to remove code comments. With OPcache enabled, "opcache.save_comments=1" must be set for Nextcloud to function.');
120
+
$level = 'error';
121
+
}
122
+
123
+
if (!$isPermitted) {
124
+
$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 "opcache.restrict_api" or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.');
0 commit comments