mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Cache类的get方法增加默认值参数
This commit is contained in:
8
library/think/cache/driver/Xcache.php
vendored
8
library/think/cache/driver/Xcache.php
vendored
@@ -56,15 +56,13 @@ class Xcache
|
||||
* 读取缓存
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param mixed $default 默认值
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name)
|
||||
public function get($name, $default = false)
|
||||
{
|
||||
$name = $this->options['prefix'] . $name;
|
||||
if (xcache_isset($name)) {
|
||||
return xcache_get($name);
|
||||
}
|
||||
return false;
|
||||
return xcache_isset($name) ? xcache_get($name) : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user