Think\Session\Driver\Redis::open PHP Метод

open() публичный Метод

打开Session
public open ( string $savePath, mixed $sessName ) : boolean
$savePath string
$sessName mixed
Результат boolean
    public function open($savePath, $sessName)
    {
        // 检测php环境
        if (!extension_loaded('redis')) {
            throw new Exception('not support:redis');
        }
        $this->handler = new \Redis();
        // 建立连接
        $func = $this->config['persistent'] ? 'pconnect' : 'connect';
        $this->handler->{$func}($this->config['host'], $this->config['port'], $this->config['timeout']);
        if ('' != $this->config['password']) {
            $this->handler->auth($this->config['password']);
        }
        if (0 != $this->config['select']) {
            $this->handler->select($this->config['select']);
        }
        return true;
    }