From 82e1d7fa8058cdddf8e3a91e288fde9747f6a36b Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 5 Jul 2012 22:20:16 +0200 Subject: [PATCH] [DDC-1735] Change file_put_contents with LOCK_EX usage to temporary filename + rename, which works on Windows NFS drives. --- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 1b012ef1e..fbac7155b 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -190,7 +190,9 @@ class ProxyFactory throw ProxyException::proxyDirectoryNotWritable(); } - file_put_contents($fileName, $file, LOCK_EX); + $tmpFileName = $fileName . '.' . uniqid("", true); + file_put_contents($tmpFileName, $file); + rename($tmpFileName, $fileName); } /**