‪TYPO3CMS  9.5
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\ApcBackend 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 (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 setDefaultLifetime ($defaultLifetime)
 
 flushByTags (array $tags)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Cache\Backend\BackendInterface
 setCache (Cache\Frontend\FrontendInterface $cache)
 
 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 25 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\ApcBackend, TYPO3\CMS\Core\Cache\Backend\ApcuBackend, and TYPO3\CMS\Core\Cache\Backend\WincacheBackend.

Definition at line 63 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 131 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 ( \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface  $cache)

Sets a reference to the cache frontend which uses this backend

Parameters
\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface$cache‪The frontend for this backend

Definition at line 89 of file AbstractBackend.php.

References TYPO3\CMS\Core\Cache\Backend\AbstractBackend\$cache, and TYPO3\CMS\Core\Cache\Frontend\FrontendInterface\getIdentifier().

Referenced by TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\__construct().

◆ 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

◆ $context

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

◆ $defaultLifetime

◆ DATETIME_EXPIRYTIME_UNLIMITED

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

Definition at line 29 of file AbstractBackend.php.

◆ UNLIMITED_LIFETIME

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

Definition at line 30 of file AbstractBackend.php.