mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
add a check for free space
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
ac06db59c7
commit
abbeaa31d7
1 changed files with 4 additions and 0 deletions
|
|
@ -439,6 +439,10 @@ class ConfigurationManager
|
||||||
if(!is_dir(DataConst::GetDataDirectory())) {
|
if(!is_dir(DataConst::GetDataDirectory())) {
|
||||||
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!");
|
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!");
|
||||||
}
|
}
|
||||||
|
$df = disk_free_space(DataConst::GetDataDirectory());
|
||||||
|
if ($df !== false && (int)$df < 10240) {
|
||||||
|
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!");
|
||||||
|
}
|
||||||
file_put_contents(DataConst::GetConfigFile(), json_encode($config));
|
file_put_contents(DataConst::GetConfigFile(), json_encode($config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue