From dc4b98363956b1617749ff0abced8f68a6a5da49 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 29 Mar 2017 19:16:12 +0200 Subject: support pushing to CappedMemoryCache Signed-off-by: Robin Appelman --- lib/private/Cache/CappedMemoryCache.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/private/Cache') 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(); } -- cgit v1.2.3