Skip to content

Commit a384f87

Browse files
mfettignicolas-grekas
authored andcommitted
[Cache] Support Redis cluster connections with predis/predis:^2.0
1 parent 2f8e1ad commit a384f87

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class PredisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCas
2020
{
2121
protected function createRedisClient(string $host): Client
2222
{
23-
return new Client([array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => 6379])]);
23+
return new Client(
24+
[array_combine(['host', 'port'], explode(':', getenv('REDIS_HOST')) + [1 => 6379])],
25+
['cluster' => 'redis']
26+
);
2427
}
2528
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"require-dev": {
2525
"doctrine/dbal": "^2.13.1|^3.0",
26-
"predis/predis": "~1.0",
26+
"predis/predis": "^1.1|^2.0",
2727
"symfony/cache": "^5.4|^6.0",
2828
"symfony/dependency-injection": "^5.4|^6.0",
2929
"symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4",

0 commit comments

Comments
 (0)