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,7 +11,6 @@
namespace think\cache\driver;
use think\Cache;
use think\Exception;
/**
@@ -41,6 +40,18 @@ class Xcache
}
}
/**
* 判断缓存
* @access public
* @param string $name 缓存变量名
* @return bool
*/
public function has($name)
{
$name = $this->options['prefix'] . $name;
return xcache_isset($name);
}
/**
* 读取缓存
* @access public