[pLog-svn] r3336 - plog/trunk/class/file

Jon Daley plogworld at jon.limedaley.com
Fri May 5 17:32:23 GMT 2006


 	I wonder if we should add a version_compare before doing a copy, 
so we can save time on those systems (>4.3.3) where we don't need to do 
the copy.  I don't know how much time it takes, presumably longer with 
bigger files, and maybe people will be confused if their host has given 
them a hard-quota, and they have exceeded it since they need two copies of 
the uploaded file for a little bit.


On Fri, 5 May 2006, mark at devel.lifetype.net wrote:

> Author: mark
> Date: 2006-05-05 04:48:51 +0000 (Fri, 05 May 2006)
> New Revision: 3336
>
> Modified:
>   plog/trunk/class/file/file.class.php
> Log:
> Fixed a bug that elena reported here: http://forums.lifetype.net/viewtopic.php?t=4500&postdays=0&postorder=asc&start=0
>
> Modified: plog/trunk/class/file/file.class.php
> ===================================================================
> --- plog/trunk/class/file/file.class.php	2006-05-05 04:05:32 UTC (rev 3335)
> +++ plog/trunk/class/file/file.class.php	2006-05-05 04:48:51 UTC (rev 3336)
> @@ -368,7 +368,12 @@
>                   $outFile = $inFile;
>                   $inFile  = $this->_fileName;
>               }
> -
> +
> +              // Checkt the $inFile and $outFile are the same file or not
> +              if ( realpath( dirname( $inFile ) ) == realpath( dirname( $outFile ) ) &&
> +                   basename( $inFile ) == basename( $outFile ) )
> +                  return true;
> +
>               // In order to work around the bug in php versions older
>               // than 4.3.3, where rename will not work across different
>               // partitions, this will be a copy and delete of the original file
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>

**************************************
Jon Daley
http://jon.limedaley.com/

Two roads diverged in a wood, and I, I took the one
less traveled by, and that has made all the difference.
-- Robert Frost, The Road Not Taken


More information about the pLog-svn mailing list