public function connect(array $server, array $options = [ ])
    {
        // Merge the global options shared by all Sentinel connections with
        // connection-specific options
        $clientOpts = array_merge($options, Arr::pull($server, 'options', [ ]));

        // Automatically set "replication" to "sentinel". This is the Sentinel
        // driver, after all.
        $clientOpts['replication'] = 'sentinel';

        // Extract the array of Sentinel connection options from the rest of
        // the client options
        $sentinelOpts = array_intersect_key($clientOpts, $this->sentinelKeys);

        // Filter the Sentinel connection options elements from the client
        // options array
        $clientOpts = array_diff_key($clientOpts, $this->sentinelKeys);

        return new PredisConnection(
            new Client($server, $clientOpts),
            $sentinelOpts
        );
    }
public function connect(array $server, array $options = [ ])
    {
        // Merge the global options shared by all Sentinel connections with
        // connection-specific options
        $clientOpts = array_merge($options, Arr::pull($server, 'options', [ ]));

        // Automatically set "replication" to "sentinel". This is the Sentinel
        // driver, after all.
        $clientOpts['replication'] = 'sentinel';

        // Extract the array of Sentinel connection options from the rest of
        // the client options
        $sentinelOpts = array_intersect_key($clientOpts, $this->sentinelKeys);

        // Filter the Sentinel connection options elements from the client
        // options array
        $clientOpts = array_diff_key($clientOpts, $this->sentinelKeys);

        return new PredisConnection(
            new Client($server, $clientOpts),
            $sentinelOpts
        );
    }
public function connect ( array $ server , array $ options = [ ] ) { // Merge the global options shared by all Sentinel connections with // connection-specific options $ clientOpts = array_merge ( $ options , Arr :: pull ( $ server , 'options' , [ ] ) ) ; // Automatically set "replication" to "sentinel". This is the Sentinel // driver, after all. $ clientOpts [ 'replication' ] = 'sentinel' ; // Extract the array of Sentinel connection options from the rest of // the client options $ sentinelOpts = array_intersect_key ( $ clientOpts , $ this -> sentinelKeys ) ; // Filter the Sentinel connection options elements from the client // options array $ clientOpts = array_diff_key ( $ clientOpts , $ this -> sentinelKeys ) ; return new PredisConnection ( new Client ( $ server , $ clientOpts ) , $ sentinelOpts ) ; }
Create a new Redis Sentinel connection from the provided configuration
options

@param array $server  The client configuration for the connection
@param array $options The global client options shared by all Sentinel
connections

@return PredisConnection The Sentinel connection containing a configured
Predis Client
Create a new Redis Sentinel connection from the provided configuration options