7
7
* where we're validating specific cluster mechanisms
8
8
*/
9
9
class Redis_Cluster_Test extends Redis_Test {
10
- private static $ _arr_node_map = [];
11
-
12
10
private $ _arr_redis_types = [
13
11
Redis::REDIS_STRING ,
14
12
Redis::REDIS_SET ,
@@ -23,6 +21,7 @@ class Redis_Cluster_Test extends Redis_Test {
23
21
RedisCluster::FAILOVER_DISTRIBUTE
24
22
];
25
23
24
+ protected static $ _arr_node_map = [];
26
25
/**
27
26
* @var string
28
27
*/
@@ -74,15 +73,16 @@ public function testSession_lockWaitTime() { return $this->markTestSkipped(); }
74
73
public function __construct ($ str_host , $ i_port , $ str_auth ) {
75
74
parent ::__construct ($ str_host , $ i_port , $ str_auth );
76
75
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 ' ));
84
77
/* Store our node map */
85
78
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
+
86
86
self ::$ _arr_node_map = array_filter (
87
87
explode ("\n" , file_get_contents ($ str_nodemap_file )
88
88
));
0 commit comments