Pārlūkot izejas kodu

merged branch jalliot/simplified-copy (PR #2030)

Commits
-------

9a05db0 Simplified Filesystem->copy()
707e8aa merged 2.0 branch
98966c8 updated VERSION and deps

Discussion
----------

Simplified Filesystem->copy()
Fabien Potencier 13 gadi atpakaļ
vecāks
revīzija
ff7f654175

+ 1 - 1
src/Symfony/Component/HttpKernel/Kernel.php

@@ -57,7 +57,7 @@ abstract class Kernel implements KernelInterface
     protected $startTime;
     protected $classes;
 
-    const VERSION = '2.0.2-DEV';
+    const VERSION = '2.1.0-DEV';
 
     /**
      * Constructor.

+ 6 - 7
src/Symfony/Component/HttpKernel/Util/Filesystem.php

@@ -33,14 +33,13 @@ class Filesystem
     {
         $this->mkdir(dirname($targetFile));
 
-        $mostRecent = false;
-        if (file_exists($targetFile)) {
-            $statTarget = stat($targetFile);
-            $statOrigin = stat($originFile);
-            $mostRecent = $statOrigin['mtime'] > $statTarget['mtime'];
+        if (!$override && file_exists($targetFile)) {
+            $doCopy = filemtime($originFile) > filemtime($targetFile);
+        } else {
+            $doCopy = true;
         }
 
-        if ($override || !file_exists($targetFile) || $mostRecent) {
+        if ($doCopy) {
             copy($originFile, $targetFile);
         }
     }
@@ -145,7 +144,7 @@ class Filesystem
      *
      * @param string  $originDir     The origin directory path
      * @param string  $targetDir     The symbolic link name
-     * @param Boolean $copyOnWindows Whether to copy files if on windows
+     * @param Boolean $copyOnWindows Whether to copy files if on Windows
      */
     public function symlink($originDir, $targetDir, $copyOnWindows = false)
     {