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

Commiteda3995

Browse files
committed
Cluster nodes from ENV
1 parent3eb60f5 commiteda3995

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎tests/RedisClusterTest.php‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* where we're validating specific cluster mechanisms
88
*/
99
class Redis_Cluster_Testextends Redis_Test {
10-
privatestatic$_arr_node_map = [];
11-
1210
private$_arr_redis_types = [
1311
Redis::REDIS_STRING,
1412
Redis::REDIS_SET,
@@ -23,6 +21,7 @@ class Redis_Cluster_Test extends Redis_Test {
2321
RedisCluster::FAILOVER_DISTRIBUTE
2422
];
2523

24+
protectedstatic$_arr_node_map = [];
2625
/**
2726
* @var string
2827
*/
@@ -74,15 +73,16 @@ public function testSession_lockWaitTime() { return $this->markTestSkipped(); }
7473
publicfunction__construct($str_host,$i_port,$str_auth) {
7574
parent::__construct($str_host,$i_port,$str_auth);
7675

77-
$str_nodemap_file =dirname($_SERVER['PHP_SELF']) .'/nodes/nodemap';
78-
79-
if (!file_exists($str_nodemap_file)) {
80-
fprintf(STDERR,"Error: Can't find nodemap file for seeds!\n");
81-
exit(1);
82-
}
83-
76+
self::$_arr_node_map =preg_split('/\s+/',getenv('REDIS_CLUSTER_NODES'));
8477
/* Store our node map */
8578
if (!self::$_arr_node_map) {
79+
$str_nodemap_file =dirname($_SERVER['PHP_SELF']) .'/nodes/nodemap';
80+
81+
if (!file_exists($str_nodemap_file)) {
82+
fprintf(STDERR,"Error: Can't find nodemap file for seeds!\n");
83+
exit(1);
84+
}
85+
8686
self::$_arr_node_map =array_filter(
8787
explode("\n",file_get_contents($str_nodemap_file)
8888
));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp