public function configure(Redis $redis, OptionsBag $conn)
    {
        if ($conn['persistent']) {
            $redis->pconnect($conn['host'], $conn['port'], $conn['timeout']);
        } else {
            $redis->connect($conn['host'], $conn['port'], $conn['timeout'], $conn['retry_interval']);
        }

        if ($conn['password']) {
            $redis->auth($conn['password']);
        }

        if ($conn['database'] >= 0) {
            $redis->select($conn['database']);
        }

        if ($conn['prefix']) {
            $redis->setOption(Redis::OPT_PREFIX, $conn['prefix']);
        }

        return $redis;
    }
public function configure(Redis $redis, OptionsBag $conn)
    {
        if ($conn['persistent']) {
            $redis->pconnect($conn['host'], $conn['port'], $conn['timeout']);
        } else {
            $redis->connect($conn['host'], $conn['port'], $conn['timeout'], $conn['retry_interval']);
        }

        if ($conn['password']) {
            $redis->auth($conn['password']);
        }

        if ($conn['database'] >= 0) {
            $redis->select($conn['database']);
        }

        if ($conn['prefix']) {
            $redis->setOption(Redis::OPT_PREFIX, $conn['prefix']);
        }

        return $redis;
    }
public function configure ( Redis $ redis , OptionsBag $ conn ) { if ( $ conn [ 'persistent' ] ) { $ redis -> pconnect ( $ conn [ 'host' ] , $ conn [ 'port' ] , $ conn [ 'timeout' ] ) ; } else { $ redis -> connect ( $ conn [ 'host' ] , $ conn [ 'port' ] , $ conn [ 'timeout' ] , $ conn [ 'retry_interval' ] ) ; } if ( $ conn [ 'password' ] ) { $ redis -> auth ( $ conn [ 'password' ] ) ; } if ( $ conn [ 'database' ] >= 0 ) { $ redis -> select ( $ conn [ 'database' ] ) ; } if ( $ conn [ 'prefix' ] ) { $ redis -> setOption ( Redis :: OPT_PREFIX , $ conn [ 'prefix' ] ) ; } return $ redis ; }
Configure the Redis instance with the parsed connection parameters.

@param Redis      $redis
@param OptionsBag $conn

@return Redis
Configure the Redis instance with the parsed connection parameters .