mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Cache类增加has方法 get方法支持默认值
This commit is contained in:
14
library/think/cache/driver/File.php
vendored
14
library/think/cache/driver/File.php
vendored
@@ -11,8 +11,6 @@
|
||||
|
||||
namespace think\cache\driver;
|
||||
|
||||
use think\Cache;
|
||||
|
||||
/**
|
||||
* 文件类型缓存类
|
||||
* @author liu21st <liu21st@gmail.com>
|
||||
@@ -86,6 +84,18 @@ class File
|
||||
return $this->options['path'] . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断缓存是否存在
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @return bool
|
||||
*/
|
||||
public function has($name)
|
||||
{
|
||||
$filename = $this->filename($name);
|
||||
return is_file($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取缓存
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user