]> git.mxchange.org Git - friendica.git/commitdiff
Make flock writing easier
authorPhilipp <admin@philipp.info>
Wed, 4 Jan 2023 07:16:40 +0000 (08:16 +0100)
committerPhilipp <admin@philipp.info>
Wed, 4 Jan 2023 07:16:40 +0000 (08:16 +0100)
src/Core/Config/Util/ConfigFileManager.php

index a3084b8323afa961dc288c4c1d96c85f7233f427..cc264ea26c1048d4eed44fe64d70f56f892effc8 100644 (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);