TYPO3
7.6
|
Public Member Functions | |
__construct ($context, array $options=array()) | |
initializeObject () | |
setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) | |
set ($entryIdentifier, $data, array $tags=array(), $lifetime=null) | |
get ($entryIdentifier) | |
has ($entryIdentifier) | |
remove ($entryIdentifier) | |
findIdentifiersByTag ($tag) | |
flush () | |
flushByTag ($tag) | |
collectGarbage () | |
Public Member Functions inherited from AbstractBackend | |
__construct ($context, array $options=array()) | |
setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) | |
setDefaultLifetime ($defaultLifetime) | |
Public Attributes | |
const | MAX_BUCKET_SIZE = 1048534 |
Public Attributes inherited from AbstractBackend | |
const | DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000' |
const | UNLIMITED_LIFETIME = 0 |
Protected Member Functions | |
setServers (array $servers) | |
setCompression ($useCompression) | |
addIdentifierToTags ($entryIdentifier, array $tags) | |
removeIdentifierFromAllTags ($entryIdentifier) | |
findTagsByIdentifier ($identifier) | |
Protected Member Functions inherited from AbstractBackend | |
calculateExpiryTime ($lifetime=null) | |
Protected Attributes | |
$memcache | |
$servers = array() | |
$flags | |
$identifierPrefix | |
Protected Attributes inherited from AbstractBackend | |
$cache | |
$cacheIdentifier | |
$context | |
$defaultLifetime = 3600 | |
A caching backend which stores cache entries by using Memcached.
This backend uses the following types of Memcache keys:
Each key is prepended with a prefix. By default prefix consists from two parts separated by underscore character and ends in yet another underscore character:
Note: When using the Memcached backend to store values of more than ~1 MB, the data will be split into chunks to make them fit into the memcached limits.
This file is a backport from FLOW3 by Ingo Renner.
Definition at line 43 of file MemcachedBackend.php.
__construct | ( | $context, | |
array | $options = array() |
||
) |
Constructs this backend
string | $context | FLOW3's application context |
array | $options | Configuration options - depends on the actual backend |
\TYPO3\CMS\Core\Cache\Exception | if memcache is not installed |
Definition at line 87 of file MemcachedBackend.php.
References AbstractBackend\$context.
|
protected |
Associates the identifier with the given tags
string | $entryIdentifier | |
array | $tags |
Definition at line 326 of file MemcachedBackend.php.
References MemcachedBackend\findIdentifiersByTag(), and MemcachedBackend\findTagsByIdentifier().
Referenced by MemcachedBackend\set().
collectGarbage | ( | ) |
Does nothing, as memcached does GC itself
Implements BackendInterface.
Definition at line 404 of file MemcachedBackend.php.
findIdentifiersByTag | ( | $tag | ) |
Finds and returns all cache entry identifiers which are tagged by the specified tag.
string | $tag | The tag to search for |
Implements TaggableBackendInterface.
Definition at line 279 of file MemcachedBackend.php.
Referenced by MemcachedBackend\addIdentifierToTags(), MemcachedBackend\flushByTag(), and MemcachedBackend\removeIdentifierFromAllTags().
|
protected |
Finds all tags for the given identifier. This function uses reverse tag index to search for tags.
string | $identifier | Identifier to find tags by |
Definition at line 392 of file MemcachedBackend.php.
Referenced by MemcachedBackend\addIdentifierToTags(), and MemcachedBackend\removeIdentifierFromAllTags().
flush | ( | ) |
Removes all cache entries of this cache.
\TYPO3\CMS\Core\Cache\Exception |
Implements BackendInterface.
Definition at line 296 of file MemcachedBackend.php.
References MemcachedBackend\flushByTag().
flushByTag | ( | $tag | ) |
Removes all cache entries of this cache which are tagged by the specified tag.
string | $tag | The tag the entries must have |
Implements TaggableBackendInterface.
Definition at line 311 of file MemcachedBackend.php.
References MemcachedBackend\findIdentifiersByTag().
Referenced by MemcachedBackend\flush().
get | ( | $entryIdentifier | ) |
Loads data from the cache.
string | $entryIdentifier | An identifier which describes the cache entry to load |
Implements BackendInterface.
Definition at line 231 of file MemcachedBackend.php.
has | ( | $entryIdentifier | ) |
Checks if a cache entry with the specified identifier exists.
string | $entryIdentifier | An identifier specifying the cache entry |
Implements BackendInterface.
Definition at line 251 of file MemcachedBackend.php.
initializeObject | ( | ) |
Initializes the identifier prefix
\TYPO3\CMS\Core\Cache\Exception |
Definition at line 130 of file MemcachedBackend.php.
References $server.
remove | ( | $entryIdentifier | ) |
Removes all cache entries matching the specified identifier. Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.
string | $entryIdentifier | Specifies the cache entry to remove |
Implements BackendInterface.
Definition at line 265 of file MemcachedBackend.php.
References MemcachedBackend\removeIdentifierFromAllTags().
|
protected |
Removes association of the identifier with the given tags
string | $entryIdentifier | |
array | Array of tags |
Definition at line 359 of file MemcachedBackend.php.
References MemcachedBackend\findIdentifiersByTag(), and MemcachedBackend\findTagsByIdentifier().
Referenced by MemcachedBackend\remove(), and MemcachedBackend\set().
set | ( | $entryIdentifier, | |
$data, | |||
array | $tags = array() , |
||
$lifetime = null |
|||
) |
Saves data in the cache.
string | $entryIdentifier | An identifier for this specific cache entry |
string | $data | The data to be stored |
array | $tags | Tags to associate with this cache entry |
int | $lifetime | Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime. |
\TYPO3\CMS\Core\Cache\Exception | if no cache frontend has been set. |
\InvalidArgumentException | if the identifier is not valid or the final memcached key is longer than 250 characters |
\TYPO3\CMS\Core\Cache\Exception\InvalidDataException | if $data is not a string |
Implements BackendInterface.
Definition at line 182 of file MemcachedBackend.php.
References AbstractBackend\$cacheIdentifier, AbstractBackend\$defaultLifetime, $GLOBALS, MemcachedBackend\addIdentifierToTags(), and MemcachedBackend\removeIdentifierFromAllTags().
setCache | ( | \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface | $cache | ) |
Initializes the identifier prefix when setting the cache.
\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface | $cache | The frontend for this backend |
Implements BackendInterface.
Definition at line 162 of file MemcachedBackend.php.
|
protected |
Setter for compression flags bit
bool | $useCompression |
Definition at line 115 of file MemcachedBackend.php.
|
protected |
Setter for servers to be used. Expects an array, the values are expected to be formatted like "<host>[:<port>]" or "unix://<path>"
array | $servers | An array of servers to add. |
Definition at line 103 of file MemcachedBackend.php.
References MemcachedBackend\$servers.
|
protected |
Definition at line 71 of file MemcachedBackend.php.
|
protected |
Definition at line 78 of file MemcachedBackend.php.
|
protected |
Definition at line 56 of file MemcachedBackend.php.
|
protected |
Definition at line 63 of file MemcachedBackend.php.
Referenced by MemcachedBackend\setServers().
const MAX_BUCKET_SIZE = 1048534 |
Definition at line 50 of file MemcachedBackend.php.