MatthiasMullie\Scrapbook\Buffered\Utils\Buffer::exists PHP Method

exists() protected method

Contrary to default MemoryStore, expired items must *not* be deleted from memory: we need to remember that they were expired, so we don't reach out to real cache (only to get nothing, since it's expired...).
protected exists ( string $key ) : boolean
$key string
return boolean
    protected function exists($key)
    {
        if (!array_key_exists($key, $this->items)) {
            // key not in cache
            return false;
        }
        $expire = $this->items[$key][1];
        if ($expire !== 0 && $expire < time()) {
            // not permanent & already expired
            return false;
        }
        $this->lru($key);
        return true;
    }