public function isValid($cacheID, $cacheTime, $renew_cachedir = true) { $filepath = PathManager::getCacheDir($cacheID, $this->cache_dir, $renew_cachedir); $_cacheFile = $filepath . $cacheID; if (!is_readable($_cacheFile)) { return false; } // clearstatcache(); //clearn filemtime function cache if ($this->life_time == 0) { return true; } $now = time(); $fileMTime = filemtime($_cacheFile); return $now - $fileMTime < $cacheTime; }