Skip to content

Commit

Permalink
fix: Remove check for PHP modules in checkServer which are already te…
Browse files Browse the repository at this point in the history
…sted by setupchecks

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Feb 24, 2025
1 parent 03ba092 commit d5406c9
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,40 +477,17 @@ public static function checkServer(\OC\SystemConfig $config) {
// 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;
Expand All @@ -521,11 +498,6 @@ public static function checkServer(\OC\SystemConfig $config) {
$missingDependencies[] = $module;
}
}
foreach ($dependencies['ini'] as $setting => $expected) {
if (strtolower($iniWrapper->getString($setting)) !== strtolower($expected)) {
$invalidIniSettings[] = [$setting, $expected];
}
}

foreach ($missingDependencies as $missingDependency) {
$errors[] = [
Expand All @@ -534,13 +506,6 @@ public static function checkServer(\OC\SystemConfig $config) {
];
$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
Expand Down

0 comments on commit d5406c9

Please sign in to comment.