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 @@ -3027,13 +3027,30 @@ protected function build_cluster_connection_array() {
3027
3027
$ cluster = array_values ( WP_REDIS_CLUSTER );
3028
3028
3029
3029
foreach ( $ cluster as $ key => $ server ) {
3030
- $ connection_string = parse_url ( $ server );
3030
+ $ components = parse_url ( $ server );
3031
3031
3032
- $ cluster [ $ key ] = sprintf (
3033
- "%s:%s " ,
3034
- $ connection_string ['host ' ],
3035
- $ connection_string ['port ' ]
3036
- );
3032
+ if ( ! empty ( $ components ['scheme ' ] ) ) {
3033
+ $ scheme = $ components ['scheme ' ];
3034
+ } elseif ( defined ( 'WP_REDIS_SCHEME ' ) ) {
3035
+ $ scheme = WP_REDIS_SCHEME ;
3036
+ } else {
3037
+ $ scheme = null ;
3038
+ }
3039
+
3040
+ if ( isset ( $ scheme ) ) {
3041
+ $ cluster [ $ key ] = sprintf (
3042
+ '%s://%s:%d ' ,
3043
+ $ scheme ,
3044
+ $ components ['host ' ],
3045
+ $ components ['port ' ]
3046
+ );
3047
+ } else {
3048
+ $ cluster [ $ key ] = sprintf (
3049
+ '%s:%d ' ,
3050
+ $ components ['host ' ],
3051
+ $ components ['port ' ]
3052
+ );
3053
+ }
3037
3054
}
3038
3055
3039
3056
return $ cluster ;
You can’t perform that action at this time.
0 commit comments