‪TYPO3CMS  10.4
TYPO3\CMS\Core\Cache\Backend\AbstractBackend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Backend\AbstractBackend:
TYPO3\CMS\Core\Cache\Backend\BackendInterface TYPO3\CMS\Core\Cache\Backend\ApcuBackend TYPO3\CMS\Core\Cache\Backend\MemcachedBackend TYPO3\CMS\Core\Cache\Backend\NullBackend TYPO3\CMS\Core\Cache\Backend\PdoBackend TYPO3\CMS\Core\Cache\Backend\RedisBackend TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend TYPO3\CMS\Core\Cache\Backend\WincacheBackend TYPO3\CMS\Core\Tests\Unit\Cache\Backend\Fixtures\ConcreteBackendFixture

Public Member Functions

 __construct ($context, array $options=[])
 
 setCache (FrontendInterface $cache)
 
 setDefaultLifetime ($defaultLifetime)
 
 flushByTags (array $tags)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Cache\Backend\BackendInterface
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
mixed get ($entryIdentifier)
 
bool has ($entryIdentifier)
 
bool remove ($entryIdentifier)
 
 flush ()
 
 collectGarbage ()
 

Public Attributes

const DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000'
 
const UNLIMITED_LIFETIME = 0
 

Protected Member Functions

DateTime calculateExpiryTime ($lifetime=null)
 

Protected Attributes

TYPO3 CMS Core Cache Frontend FrontendInterface $cache
 
string $cacheIdentifier
 
string $context
 
int $defaultLifetime = 3600
 

Detailed Description

An abstract caching backend

Definition at line 27 of file AbstractBackend.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Cache\Backend\AbstractBackend::__construct (   $context,
array  $options = [] 
)

Constructs this backend

Parameters
string$context‪Unused, for backward compatibility only
array$optionsConfiguration options - depends on the actual backend
Exceptions

Reimplemented in TYPO3\CMS\Core\Cache\Backend\RedisBackend, TYPO3\CMS\Core\Cache\Backend\MemcachedBackend, TYPO3\CMS\Core\Cache\Backend\ApcuBackend, and TYPO3\CMS\Core\Cache\Backend\WincacheBackend.

Definition at line 65 of file AbstractBackend.php.

References TYPO3\CMS\Core\Cache\Backend\AbstractBackend\$context.

Member Function Documentation

◆ calculateExpiryTime()

DateTime TYPO3\CMS\Core\Cache\Backend\AbstractBackend::calculateExpiryTime (   $lifetime = null)
protected

Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.

Parameters
int$lifetime‪The lifetime in seconds
Returns
‪\DateTime The expiry time

Definition at line 133 of file AbstractBackend.php.

References TYPO3\CMS\Core\Cache\Backend\AbstractBackend\$defaultLifetime.

◆ flushByTags()

TYPO3\CMS\Core\Cache\Backend\AbstractBackend::flushByTags ( array  $tags)

Backwards compatibility safeguard since re-introducing flushByTags as API. See https://review.typo3.org/#/c/50537/ comments for patch set 14.

The method is here even though it is only required for TaggableBackendInterface. We add it here to ensure third party cache backends do not fail but instead delegate to a less efficient linear flushing behavior.

Parameters
string[]$tags

Reimplemented in TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend.

Definition at line 119 of file AbstractBackend.php.

◆ setCache()

TYPO3\CMS\Core\Cache\Backend\AbstractBackend::setCache ( FrontendInterface  $cache)

◆ setDefaultLifetime()

TYPO3\CMS\Core\Cache\Backend\AbstractBackend::setDefaultLifetime (   $defaultLifetime)

Sets the default lifetime for this cache backend

Parameters
int$defaultLifetime‪Default lifetime of this cache backend in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Exceptions

Definition at line 101 of file AbstractBackend.php.

References TYPO3\CMS\Core\Cache\Backend\AbstractBackend\$defaultLifetime.

Member Data Documentation

◆ $cache

◆ $cacheIdentifier

string TYPO3\CMS\Core\Cache\Backend\AbstractBackend::$cacheIdentifier
protected

◆ $context

string TYPO3\CMS\Core\Cache\Backend\AbstractBackend::$context
protected

The current application context

This variable is currently unused and set to "production" always. It is only kept to keep backwards compatibility.

Definition at line 50 of file AbstractBackend.php.

Referenced by TYPO3\CMS\Core\Cache\Backend\WincacheBackend\__construct(), TYPO3\CMS\Core\Cache\Backend\AbstractBackend\__construct(), TYPO3\CMS\Core\Cache\Backend\ApcuBackend\__construct(), TYPO3\CMS\Core\Cache\Backend\MemcachedBackend\__construct(), and TYPO3\CMS\Core\Cache\Backend\RedisBackend\__construct().

◆ $defaultLifetime

◆ DATETIME_EXPIRYTIME_UNLIMITED

const TYPO3\CMS\Core\Cache\Backend\AbstractBackend::DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000'

Definition at line 31 of file AbstractBackend.php.

◆ UNLIMITED_LIFETIME

const TYPO3\CMS\Core\Cache\Backend\AbstractBackend::UNLIMITED_LIFETIME = 0

Definition at line 32 of file AbstractBackend.php.