PHP __FILE__ gives wrong location for a moved file
<p>I am using PHP to unpack an update for the PHP application itself. This is done by grabbing a zip file from the update server, unzipping it, and then recursively moving the unzipped files over the files that currently exist for the application.</p>

<p>The problem is the next time I go to use the application, __FILE__ (in at least one of the new files) gives the location in the directory where the zip file was originally unzipped. Since this is not the actual location of the file, I get errors in subsequent require function calls that use the __FILE__ to find the current directory.</p>

<p>The weirdest part: all I have to do is open the file in an editor and resave it (add and delete a space for instance), and PHP will then resolve the file path correctly. </p>

<p>Any ideas of what might be going wrong? It seems like somehow PHP "knows" where the file came from and is getting that information rather than where it is currently located. Resaving the file makes PHP (or maybe the file system) wake up.</p>
