From: Marcel Werk Date: Fri, 31 Jan 2020 17:14:02 +0000 (+0100) Subject: Added check for disabled opcache functions X-Git-Tag: 5.2.2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=70d9c46cf863ec5473d7284ad663048e3f820a51;p=GitHub%2FWoltLab%2FWCF.git Added check for disabled opcache functions --- diff --git a/wcfsetup/test.php b/wcfsetup/test.php index 53b75450bb..a2bf23784e 100644 --- a/wcfsetup/test.php +++ b/wcfsetup/test.php @@ -255,6 +255,10 @@ $phrases = [ 'de' => 'Arbeitsspeicher-Limit %s ist nicht ausreichend. 128M oder mehr wird benötigt.', 'en' => 'Memory limit %s is too low. It needs to be set to 128M or more.', ], + 'php_opcache_failure' => [ + 'de' => 'OPcache ist aktiviert aber die erforderlichen Verwaltungsfunktionen (opcache_reset, opcache_invalidate) sind deaktiviert.', + 'en' => 'OPcache is enabled but the required management functions (opcache_reset, opcache_invalidate) are disabled.', + ], 'mysql_requirements' => [ 'de' => 'MySQL', 'en' => 'MySQL Requirements' @@ -335,7 +339,7 @@ function checkHashAlgorithms() { function checkResult() { global $requiredExtensions; - if (!checkPHPVersion() || !checkHashAlgorithms() || !checkMemoryLimit()) return false; + if (!checkPHPVersion() || !checkHashAlgorithms() || !checkMemoryLimit() || !checkOpcache()) return false; foreach ($requiredExtensions as $extension) { if (!extension_loaded($extension)) return false; @@ -348,6 +352,16 @@ function checkResult() { function checkInstallFile() { return @file_exists('install.php'); } +function checkOpcache() { + if (extension_loaded('Zend Opcache') && @ini_get('opcache.enable')) { + $disabledFunctions = explode(',', @ini_get('disable_functions')); + if (in_array('opcache_reset', $disabledFunctions) || in_array('opcache_invalidate', $disabledFunctions)) { + return false; + } + } + + return true; +} ?>

WoltLab Suite System Requirements Test

@@ -387,6 +401,10 @@ function checkInstallFile() {
  • + + +
  • +