<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 23:41:04 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-1259/DDC-1259.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-1259] Atomic creation of Proxy files</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1259</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;From 265e5086ea51ebcafc73f91abc64334d17e2f416 Mon Sep 17 00:00:00 2001
From: Karsten Dambekalns &amp;lt;karsten@typo3.org&amp;gt;
Date: Wed, 25 May 2011 12:11:55 +0200
Subject: [PATCH 4/5] Use temporary file and rename &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; proxy class creation

Instead of a simple file_put_contents() the proxy class code is written to a
temporary file and renamed to the &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; filename. This allows file access even
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; only allowed by the directory permission.
---
 lib/Doctrine/ORM/Proxy/ProxyFactory.php |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index f0cf19c..b2d42fb 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -152,7 +152,15 @@ class ProxyFactory
 
         $file = str_replace($placeholders, $replacements, $file);
 
-        file_put_contents($fileName, $file, LOCK_EX);
+        $temporaryFileName = $fileName . uniqid( ) . &apos;.temp&apos;;
+        $result = file_put_contents( $temporaryFileName, $file );
+
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The temporary proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $temporaryFileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
+        $i = 0;
+        &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt;(!rename( $temporaryFileName, $fileName ) &amp;amp;&amp;amp; $i &amp;lt; 5) {
+            $i++;
+        }
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $fileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
     }
 
     /**
-- 
1.7.4.1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12802">DDC-1259</key>
            <summary>Atomic creation of Proxy files</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jul 2011 13:29:04 +0000</created>
                <updated>Sat, 9 Jul 2011 19:44:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16134" author="beberlei" created="Sat, 9 Jul 2011 19:44:50 +0000"  >&lt;p&gt;Nette Framework uses a safe stream: &lt;a href=&quot;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&quot; class=&quot;external-link&quot;&gt;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>