方法1:
Controller
has('str')){var_dump($redis->set('str','this is redis_str'));}else{var_dump($redis->get('str'));}}
}
方法2:(前方雷区!!!)
config.php
// +----------------------------------------------------------------------// | 缓存设置// +----------------------------------------------------------------------'cache' => [// 驱动方式'type' => 'File',// 缓存保存目录'path' => CACHE_PATH,// 缓存前缀'prefix' => '',//缓存有效期 0表示永久缓存'expire' => 0,],'redis' => [// 驱动方式'type' => 'redis',// 服务器地址'host' => '127.0.0.1', //redis服务器ip'port' => '6379','password'=> "",'timeout' => 86400],
Controller