File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,10 @@ private function createRedis()
116
116
*/
117
117
private function parseDsn ($ dsn )
118
118
{
119
- if (false === strpos ($ dsn , 'redis: ' )) {
120
- throw new \LogicException (sprintf ('The given DSN "%s" is not supported. Must start with "redis:". ' , $ dsn ));
119
+ $ unsupportedError = 'The given DSN "%s" is not supported. Must start with "redis:". ' ;
120
+
121
+ if ((false === strpos ($ dsn , 'redis: ' )) and (false === strpos ($ dsn , 'tls: ' ))) {
122
+ throw new \LogicException (sprintf ($ unsupportedError , $ dsn ));
121
123
}
122
124
123
125
if (false === $ config = parse_url ($ dsn )) {
@@ -131,7 +133,12 @@ private function parseDsn($dsn)
131
133
$ config = array_replace ($ queryConfig , $ config );
132
134
}
133
135
134
- unset($ config ['query ' ], $ config ['scheme ' ]);
136
+ //predis additionaly supports tls as scheme, but it must remain in the $config array
137
+ if ($ config ['vendor ' ]!='predis ' ) {
138
+ if ($ config ['scheme ' ]!='redis ' ) throw new \LogicException (sprintf ($ unsupportedError , $ dsn ));
139
+ unset($ config ['scheme ' ]);
140
+ }
141
+ unset($ config ['query ' ]);
135
142
136
143
$ config ['lazy ' ] = empty ($ config ['lazy ' ]) ? false : true ;
137
144
$ config ['persisted ' ] = empty ($ config ['persisted ' ]) ? false : true ;
You can’t perform that action at this time.
0 commit comments