/** * Test is a cache has all of the given keys. * * It is strongly recommended to avoid the use of this function if not absolutely required. * In a high load environment the cache may well change between the test and any subsequent action (get, set, delete etc). * * Its also worth mentioning that not all stores support key tests. * For stores that don't support key tests this functionality is mimicked by using the equivalent get method. * Just one more reason you should not use these methods unless you have a very good reason to do so. * * @param array $keys * @return bool True if the cache has all of the given keys, false otherwise. */ public function has_all(array $keys) { if ($this->has_a_ttl() && !$this->store_supports_native_ttl() || !$this->store_supports_key_awareness()) { foreach ($keys as $key) { if (!$this->has($key)) { return false; } } return true; } $parsedkeys = array_map(array($this, 'parse_key'), $keys); return $this->store->has_all($parsedkeys); }