use think\cache\driver\Redis;
class Index
{
public function index(){
$config = [
‘host’ => ‘127.0.0.1’,
‘port’ => 6379,
‘password’ => ‘’,
‘select’ => 0,
‘timeout’ => 0,
‘expire’ => 0,
‘persistent’ => false,
‘prefix’ => ‘’,
];
R
e
d
i
s
=
n
e
w
R
e
d
i
s
(
Redis=new Redis(
Redis=newRedis(config);
$Redis->set(“test”,“test”);
echo $Redis->get(“test”);
}