Doctrine\Common\Cache\CacheProvider
Base class for cache provider implementations.
- Author: Benjamin Eberlei <kontakt@beberlei.de>
Synopsis
class CacheProvider
implements
Cache
{
- // constants
- const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
- // members
- private string $namespace;
- private string $namespaceVersion;
- // methods
- public void setNamespace()
- public string getNamespace()
- public void fetch()
- public void contains()
- public void save()
- public void delete()
- public void getStats()
- public boolean flushAll()
- public boolean deleteAll()
- private string getNamespacedId()
- private string getNamespaceCacheKey()
- private string getNamespaceVersion()
- protected abstract string doFetch()
- protected abstract boolean doContains()
- protected abstract boolean doSave()
- protected abstract boolean doDelete()
- protected abstract boolean doFlush()
- protected abstract array doGetStats()
Hierarchy
Extended by
- Doctrine\Common\Cache\ArrayCache
- Doctrine\Common\Cache\RedisCache
- Doctrine\Common\Cache\ZendDataCache
- Doctrine\Common\Cache\MemcachedCache
- Doctrine\Common\Cache\WinCacheCache
- Doctrine\Common\Cache\FileCache
- Doctrine\Common\Cache\FilesystemCache
- Doctrine\Common\Cache\MemcacheCache
- Doctrine\Common\Cache\XcacheCache
- Doctrine\Common\Cache\ApcCache
- Doctrine\Common\Cache\PhpFileCache
Implements
Constants
Name | Value |
---|---|
DOCTRINE_NAMESPACE_CACHEKEY | 'DoctrineNamespaceCacheKey[%s]' |
STATS_HITS | 'hits' |
STATS_MISSES | 'misses' |
STATS_UPTIME | 'uptime' |
STATS_MEMORY_USAGE | 'memory_usage' |
STATS_MEMORY_AVAILIABLE | 'memory_available' |
Members
private
- $namespace — string
- $namespaceVersion — string
Methods
private
- getNamespaceCacheKey() — Namespace cache key
- getNamespaceVersion() — Namespace version
- getNamespacedId() — Prefix the passed id with the configured namespace value
protected
- doContains() — Test if an entry exists in the cache.
- doDelete() — Deletes a cache entry.
- doFetch() — Fetches an entry from the cache.
- doFlush() — Deletes all cache entries.
- doGetStats() — Retrieves cached information from data store
- doSave() — Puts data into the cache.
public
- contains() — {@inheritdoc}
- delete() — {@inheritdoc}
- deleteAll() — Delete all cache entries.
- fetch() — {@inheritdoc}
- flushAll() — Deletes all cache entries.
- getNamespace() — Retrieve the namespace that prefixes all cache ids.
- getStats() — {@inheritdoc}
- save() — {@inheritdoc}
- setNamespace() — Set the namespace to prefix all cache ids with.