Cache类增加has方法 get方法支持默认值

This commit is contained in:
thinkphp
2016-07-23 22:54:36 +08:00
parent 587bdcde2a
commit 5b98de5a59
11 changed files with 137 additions and 24 deletions

View File

@@ -11,8 +11,6 @@
namespace think\cache\driver;
use think\Cache;
/**
* 文件类型缓存类
* @author liu21st <liu21st@gmail.com>
@@ -53,6 +51,18 @@ class Lite
return $this->options['path'] . $this->options['prefix'] . md5($name) . '.php';
}
/**
* 判断缓存是否存在
* @access public
* @param string $name 缓存变量名
* @return mixed
*/
public function has($name)
{
$filename = $this->filename($name);
return is_file($filename);
}
/**
* 读取缓存
* @access public