]> _ Git - cubist_util.git/commitdiff
wip #5184 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 12:24:35 +0000 (14:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 12:24:35 +0000 (14:24 +0200)
src/Files/Files.php

index 5ebdaad2c8e2bb2e523ec44bfd85cb496a5123ec..a67e62cf8c56d10bded5ef23e937b37fb3be6c9b 100644 (file)
@@ -134,7 +134,8 @@ class Files
     {
         $do = true;
 
-        if (file_exists($to) && filemtime($from) === filemtime($to)) {
+        $frommtime = filemtime($from);
+        if (file_exists($to) && $frommtime === filemtime($to)) {
             if ($hashAlgo) {
                 $do = hash_file($hashAlgo, $from) !== hash_file($hashAlgo, $from);
             } else {
@@ -145,6 +146,7 @@ class Files
             return false;
         }
         copy($from, $to);
+        touch($to, $frommtime);
         return true;
     }