Update system_check.php

This commit is contained in:
Alix 2023-05-18 22:42:25 +03:30
parent 15bbb96124
commit 2aa99a4e80

View File

@ -65,14 +65,14 @@ foreach ($modules as $module) {
} }
$functions = array('fopen'); $functions = array('fopen');
$systemCheckOk = array();
$systemCheckError = array();
foreach ($functions as $function) { foreach ($functions as $function) {
if (function_exists($function)) { if (function_exists($function)) {
$okField = "system_ok_$function"; $systemCheckOk[$function] = true;
$systemCheckOk[$function] = $function->$okField;
} else { } else {
$errorField = "error_system_$function"; $systemCheckError[$function] = "The function $function does not exist.";
$systemCheckError[$function] = $sprache->$errorField;
} }
} }
@ -106,19 +106,19 @@ $folderArray = array(
); );
foreach ($folderArray as $folder) { foreach ($folderArray as $folder) {
if (is_dir(EASYWIDIR . "/${folder}")) { if (is_dir(EASYWIDIR . "/{$folder}")) {
$handle = @fopen(EASYWIDIR . "/${folder}test.txt", "w+"); $handle = @fopen(EASYWIDIR . "/{$folder}test.txt", "w+");
if ($handle) { if ($handle) {
fclose($handle); fclose($handle);
unlink(EASYWIDIR . "/${folder}test.txt"); unlink(EASYWIDIR . "/{$folder}test.txt");
$systemCheckOk['folders'][] = "Folder exists and can write to: ${folder}"; $systemCheckOk['folders'][] = "Folder exists and can write to: {$folder}";
} else { } else {
$systemCheckError['folders'][] = "Folder exists but cannot edit files: ${folder}"; $systemCheckError['folders'][] = "Folder exists but cannot edit files: {$folder}";
} }
} else { } else {
$systemCheckError['folders'][] = "Folder does not exist or cannot access: ${folder}"; $systemCheckError['folders'][] = "Folder does not exist or cannot access: {$folder}";
} }
} }