[HttpCachingBridgeAbstract] Remove get_cached_time and remove_from_cache
Bridges no longer require to check cache file durations manually as get_cached now supports the duration parameter
This commit is contained in:
parent
1a2a48e129
commit
3a92a1e04b
1 changed files with 0 additions and 16 deletions
|
@ -45,23 +45,7 @@ abstract class HttpCachingBridgeAbstract extends BridgeAbstract {
|
||||||
return str_get_html($content);
|
return str_get_html($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_cached_time($url){
|
|
||||||
$filepath = $this->buildCacheFilePath($url);
|
|
||||||
|
|
||||||
if(!file_exists($filepath)){
|
|
||||||
$this->get_cached($url);
|
|
||||||
}
|
|
||||||
|
|
||||||
return filectime($filepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function buildCacheFilePath($url){
|
private function buildCacheFilePath($url){
|
||||||
return __DIR__ . '/../cache/pages/' . sha1($url) . '.cache';
|
return __DIR__ . '/../cache/pages/' . sha1($url) . '.cache';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove_from_cache($url){
|
|
||||||
$filepath = $this->buildCacheFilePath($url);
|
|
||||||
$this->debugMessage('removing from cache \'' . $filepath . '\'');
|
|
||||||
unlink($filepath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue