]> _ Git - cubist_util.git/commitdiff
fix #4686
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Aug 2023 15:06:22 +0000 (17:06 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Aug 2023 15:06:22 +0000 (17:06 +0200)
src/Files/Files.php

index 288ca4e016ba32dcd43fb152c957f3a475c4701f..b7bdc307f7144fd8227f640c953d1c296dfacf2b 100644 (file)
@@ -143,9 +143,13 @@ class Files
         return $f->getBasename($suffix);
     }
 
-    public static function hashFileAttributes($path)
+    public static function hashFileAttributes($path, $additionalAttributes = [])
     {
-        return hash('sha256', $path . '/$$' . filesize($path) . '///' . filemtime($path));
+        $str = $path . '/$$' . filesize($path) . '///' . filemtime($path);
+        if ($additionalAttributes) {
+            $str .= '$$$' . print_r($additionalAttributes, true);
+        }
+        return hash('sha256', $str);
     }
 
     public static function copyFile($from, $to, $hashAlgo = false, $touch = true, $throwExceptionIfSourceNotExists = true)