support pushing to CappedMemoryCache

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-03-29 19:16:12 +02:00
parent 1ee7e1c0b1
commit dc4b983639
No known key found for this signature in database
GPG Key ID: 50F2B59C6DEBBCFE
1 changed files with 5 additions and 1 deletions

View 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();
}