Back to PhocaDownloadFile class

Method getFileTime

public static
getFileTime
(mixed $filename, mixed $function, mixed $format = 'DATE_FORMAT_LC3')

Method getFileTime - Source code

public static function getFileTime($filename, $function, $format = 'DATE_FORMAT_LC3')
{
    //$format = JText::_($format);
    $path = PhocaDownloadPath::getPathSet();
    $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;
}