From c1b6f89b2359ca31020c5030f93d18bcdc007758 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Fri, 16 Oct 2015 08:45:56 +0700 Subject: [PATCH] Workaround for Cache::write() call from DboSource::__destruct() Closes #7559 --- lib/Cake/Cache/Engine/RedisEngine.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Cache/Engine/RedisEngine.php b/lib/Cake/Cache/Engine/RedisEngine.php index b8bdd4c0d..8dd98fb99 100644 --- a/lib/Cake/Cache/Engine/RedisEngine.php +++ b/lib/Cake/Cache/Engine/RedisEngine.php @@ -113,6 +113,11 @@ class RedisEngine extends CacheEngine { if (!is_int($value)) { $value = serialize($value); } + + if (!$this->_Redis->isConnected()) { + $this->_connect(); + } + if ($duration === 0) { return $this->_Redis->set($key, $value); }