aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Cache/CappedMemoryCache.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-03-29 19:16:12 +0200
committerRobin Appelman <robin@icewind.nl>2017-03-30 11:21:32 +0200
commitdc4b98363956b1617749ff0abced8f68a6a5da49 (patch)
treea1908535d7e9658b85abfcdd90119ce1335b3351 /lib/private/Cache/CappedMemoryCache.php
parent1ee7e1c0b128b16c3327ca6aa90335ce12fd678f (diff)
downloadnextcloud-server-dc4b98363956b1617749ff0abced8f68a6a5da49.tar.gz
nextcloud-server-dc4b98363956b1617749ff0abced8f68a6a5da49.zip
support pushing to CappedMemoryCache
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Cache/CappedMemoryCache.php')
-rw-r--r--lib/private/Cache/CappedMemoryCache.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Cache/CappedMemoryCache.php b/lib/private/Cache/CappedMemoryCache.php
index c6b45c49c1c..2e180cfb013 100644
--- a/lib/private/Cache/CappedMemoryCache.php
+++ b/lib/private/Cache/CappedMemoryCache.php
@@ -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();
}