Merge pull request #4864 from MrPetovan/bug/fix-memcached-delete
Fix MemcachedCacheDrive::delete() method
This commit is contained in:
commit
32f78a4b01
2 changed files with 10 additions and 7 deletions
|
@ -50,7 +50,7 @@ class MemcachedCacheDriver extends BaseObject implements ICacheDriver
|
||||||
{
|
{
|
||||||
// We store with the hostname as key to avoid problems with other applications
|
// We store with the hostname as key to avoid problems with other applications
|
||||||
return $this->memcached->set(
|
return $this->memcached->set(
|
||||||
self::getApp()->get_hostname() . ":" . $key,
|
self::getApp()->get_hostname() . ':' . $key,
|
||||||
$value,
|
$value,
|
||||||
time() + $duration
|
time() + $duration
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,9 @@ class MemcachedCacheDriver extends BaseObject implements ICacheDriver
|
||||||
|
|
||||||
public function delete($key)
|
public function delete($key)
|
||||||
{
|
{
|
||||||
return $this->memcached->delete($key);
|
$return = $this->memcached->delete(self::getApp()->get_hostname() . ':' . $key);
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clear()
|
public function clear()
|
||||||
|
|
|
@ -24,7 +24,7 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
|
||||||
|
|
||||||
public function read($session_id)
|
public function read($session_id)
|
||||||
{
|
{
|
||||||
if (!x($session_id)) {
|
if (empty($session_id)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cache::set('session:' . $session_id, $session_data, Session::$expire);
|
$return = Cache::set('session:' . $session_id, $session_data, Session::$expire);
|
||||||
|
|
||||||
return true;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function close()
|
public function close()
|
||||||
|
@ -70,8 +70,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
Cache::delete('session:' . $id);
|
$return = Cache::delete('session:' . $id);
|
||||||
return true;
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function gc($maxlifetime)
|
public function gc($maxlifetime)
|
||||||
|
|
Loading…
Reference in a new issue