Cache类的get方法增加默认值参数

This commit is contained in:
thinkphp
2016-07-24 21:56:00 +08:00
parent bab4398552
commit 760b1d971d
11 changed files with 42 additions and 38 deletions

View File

@@ -85,19 +85,14 @@ class Cache
* 读取缓存
* @access public
* @param string $name 缓存标识
* @param string $default 默认值
* @param mixed $default 默认值
* @return mixed
*/
public static function get($name, $default = null)
public static function get($name, $default = false)
{
self::init();
self::$readTimes++;
$result = self::$handler->get($name);
if (false !== $result) {
return $result;
} else {
return $default;
}
return self::$handler->get($name, $default);
}
/**