rework favicon storage to use DiskCache
This commit is contained in:
9
classes/cache/local.php
vendored
9
classes/cache/local.php
vendored
@@ -2,12 +2,18 @@
|
||||
class Cache_Local implements Cache_Adapter {
|
||||
private string $dir;
|
||||
|
||||
public function remove(string $filename): bool {
|
||||
return unlink($this->get_full_path($filename));
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
$this->make_dir();
|
||||
}
|
||||
|
||||
public function get_dir(): string {
|
||||
@@ -131,9 +137,6 @@ class Cache_Local implements Cache_Adapter {
|
||||
if ($tmppluginhost->run_hooks_until(PluginHost::HOOK_SEND_LOCAL_FILE, true, $filename))
|
||||
return true;
|
||||
|
||||
$stamp = gmdate("D, d M Y H:i:s", (int)filemtime($filename)) . " GMT";
|
||||
header("Last-Modified: $stamp", true);
|
||||
|
||||
return readfile($filename);
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user