summaryrefslogtreecommitdiff
path: root/classes/cache/local.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-11-24 23:31:33 +0300
committerAndrew Dolgov <[email protected]>2022-11-24 23:31:33 +0300
commita30b9bb649d6e10a5d7c2feb73376669cf23ef68 (patch)
tree33716caf2286a0c544a2f053ea07c677aebd5fd4 /classes/cache/local.php
parentbe6bc72a742c5fb7f87a4495009ed71ff0fbb8d8 (diff)
rework favicon storage to use DiskCache
Diffstat (limited to 'classes/cache/local.php')
-rw-r--r--classes/cache/local.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/cache/local.php b/classes/cache/local.php
index fb8aed529..d7d0c5cb1 100644
--- a/classes/cache/local.php
+++ b/classes/cache/local.php
@@ -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;