protected function connect()
    {
        if (!is_object(self::$instance)) {
            $func = $this->options['persistent'] ? 'pconnect' : 'connect';

            self::$instance = new \Redis();
            self::$instance->$func($this->options['host'], $this->options['port'], $this->options['timeout']);

            if ('' != $this->options['password']) {
                self::$instance->auth($this->options['password']);
            }
            if (0 != $this->options['select']) {
                self::$instance->select($this->options['select']);
            }
        }
    }
protected function connect()
    {
        if (!is_object(self::$instance)) {
            $func = $this->options['persistent'] ? 'pconnect' : 'connect';

            self::$instance = new \Redis();
            self::$instance->$func($this->options['host'], $this->options['port'], $this->options['timeout']);

            if ('' != $this->options['password']) {
                self::$instance->auth($this->options['password']);
            }
            if (0 != $this->options['select']) {
                self::$instance->select($this->options['select']);
            }
        }
    }
protected function connect ( ) { if ( ! is_object ( self :: $ instance ) ) { $ func = $ this -> options [ 'persistent' ] ? 'pconnect' : 'connect' ; self :: $ instance = new \ Redis ( ) ; self :: $ instance -> $ func ( $ this -> options [ 'host' ] , $ this -> options [ 'port' ] , $ this -> options [ 'timeout' ] ) ; if ( '' != $ this -> options [ 'password' ] ) { self :: $ instance -> auth ( $ this -> options [ 'password' ] ) ; } if ( 0 != $ this -> options [ 'select' ] ) { self :: $ instance -> select ( $ this -> options [ 'select' ] ) ; } } }
Connection to redis service.
@author : evalor <master@evalor.cn>
Connection to redis service .