Display error message if config.local.php is not writable

This commit is contained in:
slawkens 2024-02-04 10:10:04 +01:00
parent e2487f97e3
commit 647eae08b4
2 changed files with 9 additions and 4 deletions

View File

@ -1651,7 +1651,12 @@ Sent by MyAAC,<br/>
} }
} }
return Settings::saveConfig($configToSave, BASE . 'config.local.php'); $success = Settings::saveConfig($configToSave, BASE . 'config.local.php');
if (!$success) {
error('There has been error saving the config.local.php - probably problem with permissions.');
}
return $success;
}, },
], ],
]; ];

View File

@ -557,10 +557,10 @@ class Settings implements \ArrayAccess
$content .= ';' . PHP_EOL; $content .= ';' . PHP_EOL;
} }
$success = file_put_contents($filename, $content); $success = @file_put_contents($filename, $content);
// we saved new config.php, need to revalidate cache (only if opcache is enabled) // we saved new config.php, need to revalidate cache (only if opcache is enabled)
if (function_exists('opcache_invalidate')) { if ($success && function_exists('opcache_invalidate')) {
opcache_invalidate($filename); opcache_invalidate($filename);
} }
@ -606,7 +606,7 @@ class Settings implements \ArrayAccess
return true; return true;
} }
public function getErrors() { public function getErrors(): array {
return $this->errors; return $this->errors;
} }