mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix serialization in Redis cache handler
This commit is contained in:
parent
fcafcb9833
commit
f50d5dd9fe
1 changed files with 3 additions and 1 deletions
4
classes/cache/CacheRedis.class.php
vendored
4
classes/cache/CacheRedis.class.php
vendored
|
|
@ -131,7 +131,7 @@ class CacheRedis extends CacheBase
|
|||
|
||||
try
|
||||
{
|
||||
return $this->redis->setex($this->getKey($key), $valid_time, array($_SERVER['REQUEST_TIME'], $buff));
|
||||
return $this->redis->setex($this->getKey($key), $valid_time, serialize(array($_SERVER['REQUEST_TIME'], $buff)));
|
||||
}
|
||||
catch(RedisException $e)
|
||||
{
|
||||
|
|
@ -151,6 +151,7 @@ class CacheRedis extends CacheBase
|
|||
{
|
||||
$_key = $this->getKey($key);
|
||||
$obj = $this->redis->get($_key);
|
||||
$obj = $obj ? unserialize($obj) : false;
|
||||
if(!$obj || !is_array($obj))
|
||||
{
|
||||
return false;
|
||||
|
|
@ -180,6 +181,7 @@ class CacheRedis extends CacheBase
|
|||
{
|
||||
$_key = $this->getKey($key);
|
||||
$obj = $this->redis->get($_key);
|
||||
$obj = $obj ? unserialize($obj) : false;
|
||||
if(!$obj || !is_array($obj))
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue