File tree Expand file tree Collapse file tree 1 file changed +4
-33
lines changed
src/phpFastCache/Drivers/Predis Expand file tree Collapse file tree 1 file changed +4
-33
lines changed Original file line number Diff line number Diff line change @@ -124,43 +124,14 @@ protected function driverClear()
124124 */
125125 protected function driverConnect ()
126126 {
127- $ server = isset ($ this ->config [ 'redis ' ]) ? $ this ->config [ 'redis ' ] : [
127+ $ config = isset ($ this ->config [ 'redis ' ]) ? $ this ->config [ 'redis ' ] : [];
128+
129+ $ this ->instance = new PredisClient (array_merge ([
128130 'host ' => '127.0.0.1 ' ,
129131 'port ' => '6379 ' ,
130132 'password ' => '' ,
131133 'database ' => '' ,
132- ];
133-
134- $ config = [
135- 'host ' => $ server [ 'host ' ],
136- ];
137-
138- $ port = isset ($ server [ 'port ' ]) ? $ server [ 'port ' ] : '' ;
139- if ($ port != '' ) {
140- $ config [ 'port ' ] = $ port ;
141- }
142-
143- $ password = isset ($ server [ 'password ' ]) ? $ server [ 'password ' ] : '' ;
144- if ($ password != '' ) {
145- $ config [ 'password ' ] = $ password ;
146- }
147-
148- $ database = isset ($ server [ 'database ' ]) ? $ server [ 'database ' ] : '' ;
149- if ($ database != '' ) {
150- $ config [ 'database ' ] = $ database ;
151- }
152-
153- $ timeout = isset ($ server [ 'timeout ' ]) ? $ server [ 'timeout ' ] : '' ;
154- if ($ timeout != '' ) {
155- $ config [ 'timeout ' ] = $ timeout ;
156- }
157-
158- $ read_write_timeout = isset ($ server [ 'read_write_timeout ' ]) ? $ server [ 'read_write_timeout ' ] : '' ;
159- if ($ read_write_timeout != '' ) {
160- $ config [ 'read_write_timeout ' ] = $ read_write_timeout ;
161- }
162-
163- $ this ->instance = new PredisClient ($ config );
134+ ], $ config ));
164135
165136 return true ;
166137 }
You can’t perform that action at this time.
0 commit comments