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