diff --git a/src/PredisEngine.php b/src/PredisEngine.php index c7898ef..4cf50ea 100644 --- a/src/PredisEngine.php +++ b/src/PredisEngine.php @@ -33,6 +33,7 @@ final class PredisEngine extends CacheEngine 'prefix' => 'cake_', 'probability' => 100, 'connections' => 'tcp://127.0.0.1:6379', + 'password' => null, 'options' => null, ]; @@ -52,6 +53,10 @@ public function init(array $config = []) $this->client = new Client($this->_config['connections'], $this->_config['options']); $this->client->connect(); + if (!is_null($this->_config['password'])) { + $this->client->auth($this->_config['password']); + } + return $this->client->isConnected(); }