mirror of
https://github.com/koel/koel
synced 2024-12-19 09:03:07 +00:00
16 lines
394 B
PHP
16 lines
394 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use SplFileInfo;
|
|
|
|
class Helper
|
|
{
|
|
public static function getModifiedTime(string|SplFileInfo $file): int
|
|
{
|
|
$file = is_string($file) ? new SplFileInfo($file) : $file;
|
|
|
|
// Workaround for #344, where getMTime() fails for certain files with Unicode names on Windows.
|
|
return attempt(static fn () => $file->getMTime()) ?? time();
|
|
}
|
|
}
|