File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ protected function parseSaveOptions()
143143 * @link https://redis.io/commands/set
144144 * @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example
145145 */
146- public function set ($ key , $ value = "" , $ timeout = null )
146+ public function set ($ key , $ value = "" , $ timeout = 0 )
147147 {
148148 return $ this ->connection ()->set ($ key , $ value , $ timeout );
149149 }
@@ -245,7 +245,7 @@ public function close()
245245 */
246246 public function connection (): Adapter
247247 {
248- if (!$ this ->redis ) {
248+ if (!$ this ->redis -> connection () ) {
249249 $ this ->redis ->connect ($ this ->config );
250250 }
251251
Original file line number Diff line number Diff line change @@ -80,6 +80,13 @@ public function ping(?string $message = null);
8080 */
8181 public function errors (): array ;
8282
83+ /**
84+ * Get the redis connection
85+ *
86+ * @return mixed
87+ */
88+ public function connection ();
89+
8390 /**
8491 * Close the redis connection
8592 *
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ public function errors(): array
8989 return $ this ->errors ;
9090 }
9191
92+ public function connection ()
93+ {
94+ return $ this ->redis ;
95+ }
96+
9297 public function close ()
9398 {
9499 $ this ->redis ->close ();
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ public function errors(): array
8686 return $ this ->errors ;
8787 }
8888
89+ public function connection ()
90+ {
91+ return $ this ->redis ;
92+ }
93+
8994 public function close ()
9095 {
9196 $ this ->redis ->disconnect ();
You can’t perform that action at this time.
0 commit comments