Back to PhocacartFile class

Method getFileTime

public static
getFileTime
(mixed $manager, mixed $filename, mixed $function, mixed $format = "d. M Y")

Method getFileTime - Source code

public static function getFileTime($manager, $filename, $function, $format = "d. M Y")
{
    $path = PhocaDownloadPath::getPath($manager);
    $fileNameAbs = Path::clean($path['orig_abs'] . '/' . $filename);
    if (File::exists($fileNameAbs)) {
        switch ($function) {
            case 2:
                $fileTime = filectime($fileNameAbs);
                break;
            case 3:
                $fileTime = fileatime($fileNameAbs);
                break;
            case 1:
            default:
                $fileTime = filemtime($fileNameAbs);
                break;
        }
        $fileTime = HTMLHelper::Date($fileTime, $format);
    } else {
        $fileTime = '';
    }
    return $fileTime;
}