mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-05-25 10:48:41 +00:00
Fix sub directory caching
This commit is contained in:
parent
92c4efac34
commit
aa93894cc3
|
|
@ -153,7 +153,7 @@ class FileCache implements CacheInterface
|
||||||
// todo: allow $key to contain / as char and create subdirectory if necessary. This is important for cleaner caching.
|
// todo: allow $key to contain / as char and create subdirectory if necessary. This is important for cleaner caching.
|
||||||
$path = File::sanitize($key, self::SANITIZE);
|
$path = File::sanitize($key, self::SANITIZE);
|
||||||
|
|
||||||
file_put_contents($this->cachePath . '/' . $path . '.cache', $this->build($value, $expire));
|
file_put_contents($this->cachePath . '/' . trim($path, '/') . '.cache', $this->build($value, $expire));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -167,8 +167,8 @@ class FileCache implements CacheInterface
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = File::sanitize($key, self::SANITIZE);
|
$path = File::sanitize($key, self::SANITIZE);
|
||||||
$path = $this->cachePath . '/' . $path . '.cache';
|
$path = $this->cachePath . '/' . trim($path, '/') . '.cache';
|
||||||
|
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
file_put_contents($path, $this->build($value, $expire));
|
file_put_contents($path, $this->build($value, $expire));
|
||||||
|
|
@ -285,7 +285,7 @@ class FileCache implements CacheInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = File::sanitize($key, self::SANITIZE);
|
$name = File::sanitize($key, self::SANITIZE);
|
||||||
$path = $this->cachePath . '/' . $name . '.cache';
|
$path = $this->cachePath . '/' . trim($name, '/') . '.cache';
|
||||||
|
|
||||||
if(!file_exists($path)) {
|
if(!file_exists($path)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -352,7 +352,7 @@ class FileCache implements CacheInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = File::sanitize($key, self::SANITIZE);
|
$name = File::sanitize($key, self::SANITIZE);
|
||||||
$path = $this->cachePath . '/' . $name . '.cache';
|
$path = $this->cachePath . '/' . trim($name, '/') . '.cache';
|
||||||
|
|
||||||
if ($expire < 0 && file_exists($path)) {
|
if ($expire < 0 && file_exists($path)) {
|
||||||
unlink($path);
|
unlink($path);
|
||||||
|
|
@ -415,7 +415,7 @@ class FileCache implements CacheInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = File::sanitize($key, self::SANITIZE);
|
$name = File::sanitize($key, self::SANITIZE);
|
||||||
$path = $this->cachePath . '/' . $path . '.cache';
|
$path = $this->cachePath . '/' . trim($path, '/') . '.cache';
|
||||||
|
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
file_put_contents($path, $this->build($value, $expire));
|
file_put_contents($path, $this->build($value, $expire));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user