Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb2977c2

Browse files
qkdreyerfabpot
authored andcommitted
Handle CSV DSN in ZookeeperStore
1 parent474fc81 commitb2977c2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎src/Symfony/Component/Lock/Store/ZookeeperStore.php‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ public static function createConnection(string $dsn): \Zookeeper
4545
}
4646

4747
$host =$params['host'] ??'';
48-
if (isset($params['port'])) {
49-
$host .=':'.$params['port'];
48+
$hosts =explode(',',$host);
49+
50+
foreach ($hostsas$index =>$host) {
51+
if (isset($params['port'])) {
52+
$hosts[$index] =$host.':'.$params['port'];
53+
}
5054
}
5155

52-
returnnew \Zookeeper($host);
56+
returnnew \Zookeeper(implode($hosts,','));
5357
}
5458

5559
/**

‎src/Symfony/Component/Lock/Tests/Store/StoreFactoryTest.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function validConnections()
6262
if (class_exists(\Zookeeper::class)) {
6363
yield [$this->createMock(\Zookeeper::class), ZookeeperStore::class];
6464
yield ['zookeeper://localhost:2181', ZookeeperStore::class];
65+
yield ['zookeeper://localhost01,localhost02:2181', ZookeeperStore::class];
6566
}
6667
if (\extension_loaded('sysvsem')) {
6768
yield ['semaphore', SemaphoreStore::class];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp