Commit f2b48d31 by Scott

Don't cache when TTL=0

parent f748dd63
...@@ -86,8 +86,9 @@ class Q2A_Storage_FileCache ...@@ -86,8 +86,9 @@ class Q2A_Storage_FileCache
public function set($key, $str, $ttl) public function set($key, $str, $ttl)
{ {
$success = false; $success = false;
$ttl = (int) $ttl;
if ($this->enabled) { if ($this->enabled && $ttl > 0) {
$file = $this->getFilename($key); $file = $this->getFilename($key);
$dir = dirname($file); $dir = dirname($file);
$expiry = time() + ($ttl * 60); $expiry = time() + ($ttl * 60);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment