File tree 1 file changed +23
-6
lines changed
1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -211,13 +211,30 @@ protected function build_cluster_connection_array() {
211
211
$ cluster = array_values ( WP_REDIS_CLUSTER );
212
212
213
213
foreach ( $ cluster as $ key => $ server ) {
214
- $ connection_string = parse_url ( $ server );
214
+ $ components = parse_url ( $ server );
215
+
216
+ if ( ! empty ( $ components ['scheme ' ] ) ) {
217
+ $ scheme = $ components ['scheme ' ];
218
+ } elseif ( defined ( 'WP_REDIS_SCHEME ' ) ) {
219
+ $ scheme = WP_REDIS_SCHEME ;
220
+ } else {
221
+ $ scheme = null ;
222
+ }
215
223
216
- $ cluster [ $ key ] = sprintf (
217
- "%s:%s " ,
218
- $ connection_string ['host ' ],
219
- $ connection_string ['port ' ]
220
- );
224
+ if ( isset ( $ scheme ) ) {
225
+ $ cluster [ $ key ] = sprintf (
226
+ '%s://%s:%d ' ,
227
+ $ scheme ,
228
+ $ components ['host ' ],
229
+ $ components ['port ' ]
230
+ );
231
+ } else {
232
+ $ cluster [ $ key ] = sprintf (
233
+ '%s:%d ' ,
234
+ $ components ['host ' ],
235
+ $ components ['port ' ]
236
+ );
237
+ }
221
238
}
222
239
223
240
return $ cluster ;
You can’t perform that action at this time.
0 commit comments