mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +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
|
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)
|
catch(RedisException $e)
|
||||||
{
|
{
|
||||||
|
|
@ -151,6 +151,7 @@ class CacheRedis extends CacheBase
|
||||||
{
|
{
|
||||||
$_key = $this->getKey($key);
|
$_key = $this->getKey($key);
|
||||||
$obj = $this->redis->get($_key);
|
$obj = $this->redis->get($_key);
|
||||||
|
$obj = $obj ? unserialize($obj) : false;
|
||||||
if(!$obj || !is_array($obj))
|
if(!$obj || !is_array($obj))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -180,6 +181,7 @@ class CacheRedis extends CacheBase
|
||||||
{
|
{
|
||||||
$_key = $this->getKey($key);
|
$_key = $this->getKey($key);
|
||||||
$obj = $this->redis->get($_key);
|
$obj = $this->redis->get($_key);
|
||||||
|
$obj = $obj ? unserialize($obj) : false;
|
||||||
if(!$obj || !is_array($obj))
|
if(!$obj || !is_array($obj))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue