Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit c1b6f89

Browse files
committed
Workaround for Cache::write() call from DboSource::__destruct()
Closes #7559
1 parent bc97754 commit c1b6f89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Cake/Cache/Engine/RedisEngine.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ public function write($key, $value, $duration) {
113113
if (!is_int($value)) {
114114
$value = serialize($value);
115115
}
116+
117+
if (!$this->_Redis->isConnected()) {
118+
$this->_connect();
119+
}
120+
116121
if ($duration === 0) {
117122
return $this->_Redis->set($key, $value);
118123
}

0 commit comments

Comments
 (0)