From: Vincent Vanwaelscappel Date: Thu, 31 Aug 2023 15:06:22 +0000 (+0200) Subject: fix #4686 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9545fd20a5cb0072c099ce9ffdc5f80e75ffc9e5;p=cubist_util.git fix #4686 --- diff --git a/src/Files/Files.php b/src/Files/Files.php index 288ca4e..b7bdc30 100644 --- a/src/Files/Files.php +++ b/src/Files/Files.php @@ -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)