From aabe39220dfbe2d914edc746799a8c74b443f986 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 4 Jan 2023 08:16:40 +0100 Subject: [PATCH] Make flock writing easier --- src/Core/Config/Util/ConfigFileManager.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Core/Config/Util/ConfigFileManager.php b/src/Core/Config/Util/ConfigFileManager.php index a3084b8323..cc264ea26c 100644 --- a/src/Core/Config/Util/ConfigFileManager.php +++ b/src/Core/Config/Util/ConfigFileManager.php @@ -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);