File tree 1 file changed +6
-1
lines changed
Filter options
src/Symfony/Component/Cache/Adapter 1 file changed +6
-1
lines changed
Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ public static function createConnection($dsn, array $options = array())
90
90
$ params ['dbindex ' ] = $ m [1 ];
91
91
$ params ['path ' ] = substr ($ params ['path ' ], 0 , -strlen ($ m [0 ]));
92
92
}
93
+ if (isset ($ params ['host ' ])) {
94
+ $ scheme = 'tcp ' ;
95
+ } else {
96
+ $ scheme = 'unix ' ;
97
+ }
93
98
$ params += array (
94
99
'host ' => isset ($ params ['host ' ]) ? $ params ['host ' ] : $ params ['path ' ],
95
100
'port ' => isset ($ params ['host ' ]) ? 6379 : null ,
@@ -120,7 +125,7 @@ public static function createConnection($dsn, array $options = array())
120
125
throw new InvalidArgumentException (sprintf ('Redis connection failed (%s): %s ' , $ e , $ dsn ));
121
126
}
122
127
} elseif (is_a ($ class , \Predis \Client::class, true )) {
123
- $ params ['scheme ' ] = isset ( $ params [ ' host ' ]) ? ' tcp ' : ' unix ' ;
128
+ $ params ['scheme ' ] = $ scheme ;
124
129
$ params ['database ' ] = $ params ['dbindex ' ] ?: null ;
125
130
$ params ['password ' ] = $ auth ;
126
131
$ redis = new $ class ((new Factory ())->create ($ params ));
You can’t perform that action at this time.
0 commit comments