1
1
Fork 0

Make flock writing easier

This commit is contained in:
Philipp Holzer 2023-01-04 08:16:40 +01:00
parent c057954896
commit aabe39220d
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432

View file

@ -214,10 +214,9 @@ class ConfigFileManager
throw new ConfigFileException('config source cannot get encoded');
}
$configStream = fopen($this->configDir . '/' . self::CONFIG_DATA_FILE, 'w+');
$configStream = fopen($this->configDir . '/' . self::CONFIG_DATA_FILE, 'w');
if (flock($configStream, LOCK_EX)) {
ftruncate($configStream, 0);
fwrite($configStream, $encodedData);
fflush($configStream);
flock($configStream, LOCK_UN);