From: Philipp Date: Wed, 4 Jan 2023 07:16:40 +0000 (+0100) Subject: Make flock writing easier X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aabe39220dfbe2d914edc746799a8c74b443f986;p=friendica.git Make flock writing easier --- 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);