From: Vincent Vanwaelscappel Date: Tue, 19 Sep 2023 09:37:05 +0000 (+0200) Subject: wip #6260 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3e106a6aeccec93488d2b4e9db1bd67c56964b82;p=cubist_util.git wip #6260 @0.25 --- diff --git a/src/Env.php b/src/Env.php new file mode 100644 index 0000000..5a919be --- /dev/null +++ b/src/Env.php @@ -0,0 +1,21 @@ +getMessage())); } } @@ -145,12 +145,18 @@ class Files return $f->getBasename($suffix); } - public static function hashFileAttributes($path, $additionalAttributes = []) + public static function hashFileAttributes($paths, $additionalAttributes = []) { - $str = $path . '/$$' . filesize($path) . '///' . filemtime($path); - if ($additionalAttributes) { - $str .= '$$$' . print_r($additionalAttributes, true); + if (!is_array($paths)) { + $paths = [$paths]; } + foreach ($paths as $path) { + $str = $path . '/$$' . filesize($path) . '///' . filemtime($path); + if ($additionalAttributes) { + $str .= '$$$' . print_r($additionalAttributes, true); + } + } + return hash('sha256', $str); }