update_rss_feed: use DiskCache to store feed data
This commit is contained in:
5
classes/cache/adapter.php
vendored
5
classes/cache/adapter.php
vendored
@@ -9,6 +9,11 @@ interface Cache_Adapter {
|
||||
* @return int|false -1 if the file doesn't exist, false if an error occurred, size in bytes otherwise
|
||||
*/
|
||||
public function get_size(string $filename);
|
||||
|
||||
/**
|
||||
* @return int|false -1 if the file doesn't exist, false if an error occurred, timestamp otherwise
|
||||
*/
|
||||
public function get_mtime(string $filename);
|
||||
/**
|
||||
* @param mixed $data
|
||||
*
|
||||
|
||||
4
classes/cache/local.php
vendored
4
classes/cache/local.php
vendored
@@ -2,6 +2,10 @@
|
||||
class Cache_Local implements Cache_Adapter {
|
||||
private string $dir;
|
||||
|
||||
public function get_mtime(string $filename) {
|
||||
return filemtime($this->get_full_path($filename));
|
||||
}
|
||||
|
||||
public function set_dir(string $dir) : void {
|
||||
$this->dir = Config::get(Config::CACHE_DIR) . "/" . basename(clean($dir));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user