File tree Expand file tree Collapse file tree
lib/Phpfastcache/Drivers/Predis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ class Config extends ConfigurationOption
5555 */
5656 protected $ timeout = 5 ;
5757
58+ /**
59+ * @var bool
60+ */
61+ protected $ persistent = false ;
62+
5863 /**
5964 * @return string
6065 */
@@ -196,4 +201,22 @@ public function setTimeout(int $timeout): self
196201 $ this ->timeout = $ timeout ;
197202 return $ this ;
198203 }
204+
205+ /**
206+ * @return bool
207+ */
208+ public function isPersistent (): bool
209+ {
210+ return $ this ->persistent ;
211+ }
212+
213+ /**
214+ * @param bool $persistent
215+ * @return Config
216+ */
217+ public function setPersistent (bool $ persistent ): Config
218+ {
219+ $ this ->persistent = $ persistent ;
220+ return $ this ;
221+ }
199222}
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ protected function driverConnect(): bool
8282 if (!empty ($ this ->getConfig ()->getPath ())) {
8383 $ this ->instance = new PredisClient ([
8484 'scheme ' => 'unix ' ,
85+ 'persistent ' => $ this ->getConfig ()->isPersistent (),
8586 'timeout ' => $ this ->getConfig ()->getTimeout (),
8687 'path ' => $ this ->getConfig ()->getPath (),
8788 ], $ options );
You can’t perform that action at this time.
0 commit comments