// 切换库 $redis = new \x\Redis(); $redis->select(12); // 执行指令 $redis->set('name', '小黄牛'); $redis->get('name'); // 归还连接 $redis->return();
提示:在主动归还连接前,不需要切换回配置文件中的默认库,因为在获取连接时,\x\Reids组件会自动修改回配置文件中的默认库。
\x\Reids