diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-02-25 09:05:36 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-02-25 09:05:36 +0100 |
commit | 7cd55a3306674ef7491d2c3a5610d815170d2687 (patch) | |
tree | 9b50a09ef170b44bb6d167069a4112c973fd4184 | |
parent | d5406c998e97a1437e6620030620633c658e55d4 (diff) | |
download | nextcloud-server-7cd55a3306674ef7491d2c3a5610d815170d2687.tar.gz nextcloud-server-7cd55a3306674ef7491d2c3a5610d815170d2687.zip |
revert: "fix: Remove check for PHP modules in checkServer which are already tested by setupchecks"
This reverts commit d5406c998e97a1437e6620030620633c658e55d4.
-rw-r--r-- | lib/private/legacy/OC_Util.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 291d7d77823..f82082d3d12 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -477,17 +477,40 @@ class OC_Util { // If the dependency is not found the missing module name is shown to the EndUser // When adding new checks always verify that they pass on CI as well $dependencies = [ + 'classes' => [ + 'ZipArchive' => 'zip', + 'DOMDocument' => 'dom', + 'XMLWriter' => 'XMLWriter', + 'XMLReader' => 'XMLReader', + ], 'functions' => [ + 'xml_parser_create' => 'libxml', + 'mb_strcut' => 'mbstring', + 'ctype_digit' => 'ctype', + 'json_encode' => 'JSON', + 'gd_info' => 'GD', + 'gzencode' => 'zlib', 'simplexml_load_string' => 'SimpleXML', 'hash' => 'HASH Message Digest Framework', + 'curl_init' => 'cURL', + 'openssl_verify' => 'OpenSSL', ], 'defined' => [ 'PDO::ATTR_DRIVER_NAME' => 'PDO' ], + 'ini' => [ + 'default_charset' => 'UTF-8', + ], ]; $missingDependencies = []; + $invalidIniSettings = []; $iniWrapper = \OC::$server->get(IniGetWrapper::class); + foreach ($dependencies['classes'] as $class => $module) { + if (!class_exists($class)) { + $missingDependencies[] = $module; + } + } foreach ($dependencies['functions'] as $function => $module) { if (!function_exists($function)) { $missingDependencies[] = $module; @@ -498,6 +521,11 @@ class OC_Util { $missingDependencies[] = $module; } } + foreach ($dependencies['ini'] as $setting => $expected) { + if (strtolower($iniWrapper->getString($setting)) !== strtolower($expected)) { + $invalidIniSettings[] = [$setting, $expected]; + } + } foreach ($missingDependencies as $missingDependency) { $errors[] = [ @@ -506,6 +534,13 @@ class OC_Util { ]; $webServerRestart = true; } + foreach ($invalidIniSettings as $setting) { + $errors[] = [ + 'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]), + 'hint' => $l->t('Adjusting this setting in php.ini will make Nextcloud run again') + ]; + $webServerRestart = true; + } /** * The mbstring.func_overload check can only be performed if the mbstring |