TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend:
TYPO3\CMS\Core\Cache\Backend\AbstractBackend TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface TYPO3\CMS\Core\Cache\Backend\TransientBackendInterface TYPO3\CMS\Core\Cache\Backend\BackendInterface TYPO3\CMS\Core\Cache\Backend\BackendInterface TYPO3\CMS\Core\Cache\Backend\BackendInterface

Public Member Functions

 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 findIdentifiersByTag ($tag)
 
 flush ()
 
 flushByTag ($tag)
 
 collectGarbage ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 __construct ($context, array $options=[])
 
 setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 setDefaultLifetime ($defaultLifetime)
 

Protected Attributes

 $entries = []
 
 $tagsAndEntries = []
 
- Protected Attributes inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 $cache
 
 $cacheIdentifier
 
 $context
 
 $defaultLifetime = 3600
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
const DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000'
 
const UNLIMITED_LIFETIME = 0
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 calculateExpiryTime ($lifetime=null)
 

Detailed Description

A caching backend which stores cache entries during one script run.

This file is a backport from FLOW3

Definition at line 23 of file TransientMemoryBackend.php.

Member Function Documentation

◆ collectGarbage()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::collectGarbage ( )

Does nothing

Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 154 of file TransientMemoryBackend.php.

◆ findIdentifiersByTag()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::findIdentifiersByTag (   $tag)

Finds and returns all cache entry identifiers which are tagged by the specified tag.

Parameters
string$tagThe tag to search for
Returns
array An array with identifiers of all matching entries. An empty array if no entries matched

Implements TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface.

Definition at line 112 of file TransientMemoryBackend.php.

Referenced by TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend\flushByTag().

◆ flush()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::flush ( )

Removes all cache entries of this cache.

Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 127 of file TransientMemoryBackend.php.

◆ flushByTag()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::flushByTag (   $tag)

Removes all cache entries of this cache which are tagged by the specified tag.

Parameters
string$tagThe tag the entries must have
Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface.

Definition at line 140 of file TransientMemoryBackend.php.

References TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend\findIdentifiersByTag().

◆ get()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::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

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 65 of file TransientMemoryBackend.php.

◆ has()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::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

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 77 of file TransientMemoryBackend.php.

◆ remove()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::remove (   $entryIdentifier)

Removes all cache entries matching the specified identifier.

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

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 89 of file TransientMemoryBackend.php.

◆ set()

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::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
int$lifetimeLifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime.
Returns
void
Exceptions

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 47 of file TransientMemoryBackend.php.

Member Data Documentation

◆ $entries

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::$entries = []
protected

Definition at line 28 of file TransientMemoryBackend.php.

◆ $tagsAndEntries

TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::$tagsAndEntries = []
protected

Definition at line 33 of file TransientMemoryBackend.php.