]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4864 from MrPetovan/bug/fix-memcached-delete
authorMichael Vogel <icarus@dabo.de>
Thu, 19 Apr 2018 06:16:18 +0000 (08:16 +0200)
committerGitHub <noreply@github.com>
Thu, 19 Apr 2018 06:16:18 +0000 (08:16 +0200)
Fix MemcachedCacheDrive::delete() method

src/Core/Cache/MemcachedCacheDriver.php
src/Core/Session/CacheSessionHandler.php

index d6b8d4ad5808146d00d9b8110c30770eaf019834..78a4a6bdfe28c8fd477afd5f8ac37ad23be61337 100644 (file)
@@ -50,7 +50,7 @@ class MemcachedCacheDriver extends BaseObject implements ICacheDriver
        {
                // We store with the hostname as key to avoid problems with other applications
                return $this->memcached->set(
-                       self::getApp()->get_hostname() . ":" . $key,
+                       self::getApp()->get_hostname() . ':' . $key,
                        $value,
                        time() + $duration
                );
@@ -58,7 +58,9 @@ class MemcachedCacheDriver extends BaseObject implements ICacheDriver
 
        public function delete($key)
        {
-               return $this->memcached->delete($key);
+               $return = $this->memcached->delete(self::getApp()->get_hostname() . ':' . $key);
+
+               return $return;
        }
 
        public function clear()
index 463fd33d3eff0d40de528b1446d64a892f9bef7d..507735c4fc41a11391c9b70deefb416ab337d653 100644 (file)
@@ -24,7 +24,7 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
 
        public function read($session_id)
        {
-               if (!x($session_id)) {
+               if (empty($session_id)) {
                        return '';
                }
 
@@ -58,9 +58,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
                        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()
@@ -70,8 +70,9 @@ class CacheSessionHandler extends BaseObject implements SessionHandlerInterface
 
        public function destroy($id)
        {
-               Cache::delete('session:' . $id);
-               return true;
+               $return = Cache::delete('session:' . $id);
+
+               return $return;
        }
 
        public function gc($maxlifetime)