1.首先想问一下一台redis服务器上有不同的项目,需要给redis的key加项目的前缀吗?还是用select不同数据库就好了?有12个可选
2.之前使用redis也只是简单封装了一下而已,就直接调用原生的redis接口,这样足够了吗?
$func = $options['persistent'] ? 'pconnect' : 'connect';
$this->handler = new \Redis;
$options['timeout'] === false ?
$this->handler->$func($options['host'], $options['port']) :
$this->handler->$func($options['host'], $options['port'], $options['timeout']);
$options['auth'] === false ?
'':
$this->handler->auth($options['auth']);
$this->handler->select($options['select']);
return $this->handler;
1.加前缀,为了以后的扩展,Redis集群不像单机Redis那样支持多数据库功能,集群只使用默认的 0 号数据库,并且不能使用SELECT命令
2.觉得没有封装的必要