TYPO3  7.6
Public Member Functions | List of all members
BackendInterface Interface Reference
Inheritance diagram for BackendInterface:
AbstractBackend FreezableBackendInterface PhpCapableBackendInterface TaggableBackendInterface ApcBackend MemcachedBackend NullBackend PdoBackend RedisBackend SimpleFileBackend TransientMemoryBackend Typo3DatabaseBackend WincacheBackend XcacheBackend FileBackend FileBackend NullBackend SimpleFileBackend ApcBackend FileBackend MemcachedBackend NullBackend PdoBackend RedisBackend TransientMemoryBackend Typo3DatabaseBackend WincacheBackend XcacheBackend

Public Member Functions

 setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 set ($entryIdentifier, $data, array $tags=array(), $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

collectGarbage ( )
flush ( )
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, SimpleFileBackend, MemcachedBackend, FileBackend, Typo3DatabaseBackend, ApcBackend, PdoBackend, XcacheBackend, WincacheBackend, TransientMemoryBackend, and NullBackend.

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, SimpleFileBackend, MemcachedBackend, FileBackend, Typo3DatabaseBackend, ApcBackend, PdoBackend, XcacheBackend, WincacheBackend, TransientMemoryBackend, and NullBackend.

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, SimpleFileBackend, MemcachedBackend, FileBackend, Typo3DatabaseBackend, ApcBackend, PdoBackend, XcacheBackend, WincacheBackend, TransientMemoryBackend, and NullBackend.

set (   $entryIdentifier,
  $data,
array  $tags = array(),
  $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\CMS\Core\Cache\Exceptionif no cache frontend has been set.
\TYPO3\CMS\Core\Cache\Exception\InvalidDataExceptionif the data is not a string

Implemented in RedisBackend, SimpleFileBackend, MemcachedBackend, FileBackend, ApcBackend, Typo3DatabaseBackend, PdoBackend, XcacheBackend, WincacheBackend, TransientMemoryBackend, and NullBackend.

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 MemcachedBackend, FileBackend, SimpleFileBackend, ApcBackend, Typo3DatabaseBackend, and AbstractBackend.