提交 bce88942 编写于 作者: lzc828's avatar lzc828

文件缓存 无过期时间

上级 9e20d48a
......@@ -31,7 +31,7 @@ class File extends Cache
}
$prev = md5($p . $prev);
}
return static::$conf['prefix'] . $key . '#tag_' . $prev;
return static::$conf['prefix'] . $key . '#tag_' . $prev;
} else {
return static::$conf['prefix'] . $key;
}
......@@ -76,6 +76,7 @@ class File extends Cache
public function set($key, $val, $ttl = 0, $tags = [])
{
$ttl = $ttl === 0 ? 315360000 : $ttl;
$key = $this->getTagKey($key, $tags);
$file = $this->getFileName($key);
file_put_contents($file, (time() + $ttl) . serialize($val));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册