Skip to content
Permalink
Browse files

Data must be serialized before being written

Data is unserialized by redis engine on read, so we have to serialized
on write.
  • Loading branch information...
markstory committed Aug 9, 2015
1 parent d6251ef commit 67585d6fe1561dcee979fc9315d03b2ec9bd7384
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/Cake/Cache/Engine/RedisEngine.php
@@ -239,6 +239,10 @@ public function __destruct() {
* @link https://github.com/phpredis/phpredis#setnx
*/
public function add($key, $value, $duration) {
if (!is_int($value)) {
$value = serialize($value);
}
$result = $this->_Redis->setnx($key, $value);
// setnx() doesn't have an expiry option, so overwrite the key with one
if ($result) {

0 comments on commit 67585d6

Please sign in to comment.
You can’t perform that action at this time.