]> source.dussan.org Git - nextcloud-server.git/commitdiff
support pushing to CappedMemoryCache
authorRobin Appelman <robin@icewind.nl>
Wed, 29 Mar 2017 17:16:12 +0000 (19:16 +0200)
committerRobin Appelman <robin@icewind.nl>
Thu, 30 Mar 2017 09:21:32 +0000 (11:21 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Cache/CappedMemoryCache.php

index c6b45c49c1c10e699a300baf60b2eada6998b9ba..2e180cfb013011b0997eb6e69fb5f75bea71ad1d 100644 (file)
@@ -47,7 +47,11 @@ class CappedMemoryCache implements ICache, \ArrayAccess {
        }
 
        public function set($key, $value, $ttl = 0) {
-               $this->cache[$key] = $value;
+               if (is_null($key)) {
+                       $this->cache[] = $value;
+               } else {
+                       $this->cache[$key] = $value;
+               }
                $this->garbageCollect();
        }