<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 22:10:21 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Fake uploading files]]></title>
      <guid>http://www.phpdeveloper.org/news/12078</guid>
      <link>http://www.phpdeveloper.org/news/12078</link>
      <description><![CDATA[<p>
<i>Mikko Koppanen</i> has <a href="http://valokuva.org/?p=132">posted about</a> an extension he's written up that has only one real purpose - to help with unit testing a script with a file upload involved (making a "fake upload" possible).
</p>
<blockquote>
The extension is doing things that shouldn't be done, it probably doesn't even run anywhere else than on CLI, it is insecure, it might behave incorrectly but in this scenario it worked fine so I decided to share it.
</blockquote>
<p>
This "use at your own risk" extension gives you a new function to use instead of the normal <a href="http://php.net/move_uploaded_file">move_uploaded_file</a>, appropriately named "fakeupload_file". It creates the fake file so that even calls to <a href="http://php.net/is_uploaded_file">is_uploaded_file</a> will see it as if it was correctly on the file system. An <a href="http://php.net/unlink">unlink</a> is all that's needed to remove the "file".
</p>]]></description>
      <pubDate>Fri, 06 Mar 2009 08:44:39 -0600</pubDate>
    </item>
  </channel>
</rss>
