public static function isFile($path)
{
$path = self::clean($path);
return file_exists($path) && is_file($path);
}
/** * Check is current cache is expired */ public function isExpired() { if (!FS::isFile($this->_resultFile)) { return true; } $fileAge = abs(time() - filemtime($this->_resultFile)); if ($fileAge >= $this->_cache_ttl) { return true; } $firstLine = trim(FS::firstLine($this->_resultFile)); $expected = trim($this->_getHeader()); if ($expected === $firstLine) { return false; } return true; }