TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
BackendInterface Interface Reference
Inheritance diagram for BackendInterface:
AbstractBackend FreezableBackendInterface PhpCapableBackendInterface TaggableBackendInterface TransientBackendInterface BackendFixture ApcBackend ApcuBackend MemcachedBackend NullBackend PdoBackend RedisBackend SimpleFileBackend TransientMemoryBackend Typo3DatabaseBackend WincacheBackend ConcreteBackendFixture FileBackend FileBackend NullBackend SimpleFileBackend ApcBackend ApcuBackend FileBackend MemcachedBackend NullBackend PdoBackend RedisBackend TransientMemoryBackend Typo3DatabaseBackend WincacheBackend TransientMemoryBackend BackendConfigurationOptionFixture BackendDefaultFixture BackendInitializeObjectFixture

Public Member Functions

 setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 collectGarbage ()
 

Detailed Description

A contract for a Cache Backend

Definition at line 21 of file core/Classes/Cache/Backend/BackendInterface.php.

Member Function Documentation

get (   $entryIdentifier)

Loads data from the cache.

Parameters
string$entryIdentifierAn identifier which describes the cache entry to load
Returns
mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded

Implemented in RedisBackend, MemcachedBackend, SimpleFileBackend, FileBackend, ApcuBackend, ApcBackend, PdoBackend, Typo3DatabaseBackend, WincacheBackend, TransientMemoryBackend, NullBackend, BackendFixture, and ConcreteBackendFixture.

has (   $entryIdentifier)

Checks if a cache entry with the specified identifier exists.

Parameters
string$entryIdentifierAn identifier specifying the cache entry
Returns
bool TRUE if such an entry exists, FALSE if not

Implemented in RedisBackend, MemcachedBackend, SimpleFileBackend, FileBackend, ApcuBackend, ApcBackend, Typo3DatabaseBackend, PdoBackend, WincacheBackend, TransientMemoryBackend, NullBackend, BackendFixture, and ConcreteBackendFixture.

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.

Parameters
string$entryIdentifierSpecifies the cache entry to remove
Returns
bool TRUE if (at least) an entry could be removed or FALSE if no entry was found

Implemented in RedisBackend, MemcachedBackend, SimpleFileBackend, FileBackend, Typo3DatabaseBackend, ApcuBackend, ApcBackend, PdoBackend, WincacheBackend, TransientMemoryBackend, NullBackend, BackendFixture, and ConcreteBackendFixture.

set (   $entryIdentifier,
  $data,
array  $tags = [],
  $lifetime = null 
)

Saves data in the cache.

Parameters
string$entryIdentifierAn identifier for this specific cache entry
string$dataThe data to be stored
array$tagsTags to associate with this cache entry. If the backend does not support tags, this option can be ignored.
int$lifetimeLifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Returns
void
Exceptions
TYPO3 if no cache frontend has been set.
TYPO3 if the data is not a string

Implemented in RedisBackend, MemcachedBackend, SimpleFileBackend, ApcuBackend, ApcBackend, FileBackend, PdoBackend, Typo3DatabaseBackend, WincacheBackend, TransientMemoryBackend, NullBackend, BackendFixture, and ConcreteBackendFixture.

Sets a reference to the cache frontend which uses this backend

Parameters
\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface$cacheThe frontend for this backend
Returns
void

Implemented in FileBackend, ApcuBackend, ApcBackend, AbstractBackend, and SimpleFileBackend.