(time() - (int)$expire)) ? false : true; } static public function get($id) { $path = self::_getCachePath($id); return file_get_contents($path); } static public function display($id) { $path = self::_getCachePath($id); return readfile($path); } static public function getPath($id) { return self::_getCachePath($id); } static public function remove($id) { $path = self::_getCachePath($id); return unlink($path); } static public function clean($expire = self::CLEAN_EXPIRE) { $dir = self::_getCacheDir(); $d = dir($dir); $expire = time() - $expire; while ($file = $d->read()) { if ($file[0] == '.') { continue; } if (filemtime($dir . '/' . $file) > $expire) { unlink($dir . '/' . $file); } } $d->close(); return true; } }