mirror of https://tt-rss.org/git/tt-rss.git
force-set absolute path for local cache if CACHE_DIR config value is relative
This commit is contained in:
parent
435c321caa
commit
ae5e7568f5
|
@ -11,7 +11,14 @@ class Cache_Local implements Cache_Adapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_dir(string $dir) : void {
|
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();
|
$this->make_dir();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue