diff --git a/classes/Cache_Local.php b/classes/Cache_Local.php index 8ac634a3e..dd3548111 100644 --- a/classes/Cache_Local.php +++ b/classes/Cache_Local.php @@ -11,7 +11,14 @@ class Cache_Local implements Cache_Adapter { } public function set_dir(string $dir) : void { - $this->dir = Config::get(Config::CACHE_DIR) . "/" . basename(clean($dir)); + $cache_dir = Config::get(Config::CACHE_DIR); + + // use absolute path local to current dir if CACHE_DIR is relative + // TODO: maybe add a special method to Config() for this? + if ($cache_dir[0] != '/') + $cache_dir = dirname(__DIR__) . "/$cache_dir"; + + $this->dir = $cache_dir . "/" . basename(clean($dir)); $this->make_dir(); }