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)