ArrayCache
class ArrayCache extends CacheProvider (View source)
Array cache driver.
Constants
DOCTRINE_NAMESPACE_CACHEKEY |
|
Methods
Sets the namespace to prefix all cache ids with.
Returns an associative array of values for keys is found in cache.
Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
Fetches an entry from the cache.
Tests if an entry exists in the cache.
Puts data into the cache.
Deletes a cache entry.
Flushes all cache entries.
Retrieves cached information from the data store.
Details
in CacheProvider at line 57
void
setNamespace(string $namespace)
Sets the namespace to prefix all cache ids with.
in CacheProvider at line 68
string
getNamespace()
Retrieves the namespace that prefixes all cache ids.
in CacheProvider at line 76
mixed
fetch(string $id)
Fetches an entry from the cache.
in CacheProvider at line 84
mixed[]
fetchMultiple(array $keys)
Returns an associative array of values for keys is found in cache.
in CacheProvider at line 109
bool
contains(string $id)
Tests if an entry exists in the cache.
in CacheProvider at line 117
bool
save(string $id, mixed $data, int $lifeTime = 0)
Puts data into the cache.
If a cache entry with the given id already exists, its data will be replaced.
in CacheProvider at line 125
bool
delete(string $id)
Deletes a cache entry.
in CacheProvider at line 133
array|null
getStats()
Retrieves cached information from the data store.
The server's statistics array has the following values:
hits Number of keys that have been requested and found present.
misses Number of items that have been requested and not found.
uptime Time that the server is running.
memory_usage Memory used by this server to store items.
memory_available Memory allowed to use for storage.
in CacheProvider at line 141
bool
flushAll()
Flushes all cache entries, globally.
in CacheProvider at line 149
bool
deleteAll()
Deletes all cache entries in the current cache namespace.
in CacheProvider at line 210
protected array
doFetchMultiple(array $keys)
Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
at line 43
protected mixed|false
doFetch(string $id)
Fetches an entry from the cache.
at line 51
protected bool
doContains(string $id)
Tests if an entry exists in the cache.
at line 60
protected bool
doSave(string $id, string $data, int $lifeTime = 0)
Puts data into the cache.
at line 70
protected bool
doDelete(string $id)
Deletes a cache entry.
at line 80
protected bool
doFlush()
Flushes all cache entries.
at line 90
protected array|null
doGetStats()
Retrieves cached information from the data store.