From 3e106a6aeccec93488d2b4e9db1bd67c56964b82 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 19 Sep 2023 11:37:05 +0200 Subject: [PATCH] wip #6260 @0.25 --- src/Env.php | 21 +++++++++++++++++++++ src/Files/Files.php | 16 +++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 src/Env.php 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); } -- 2.39.5