Skip to content

Commit

Permalink
check version
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 13, 2019
1 parent b235013 commit 1371940
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Illuminate/Redis/Connectors/PhpRedisConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,23 @@ protected function establishConnection($client, array $config)
*/
protected function createRedisClusterInstance(array $servers, array $options)
{
if (version_compare(phpversion('redis'), '4.3.0', '>=')) {
return new RedisCluster(
null,
array_values($servers),
$options['timeout'] ?? 0,
$options['read_timeout'] ?? 0,
isset($options['persistent']) && $options['persistent'],
$options['password'] ?? null
);
}

return new RedisCluster(
null,
array_values($servers),
$options['timeout'] ?? 0,
$options['read_timeout'] ?? 0,
isset($options['persistent']) && $options['persistent'],
$options['password'] ?? null
isset($options['persistent']) && $options['persistent']
);
}
}

0 comments on commit 1371940

Please sign in to comment.