TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Cache\Frontend\FrontendInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Frontend\FrontendInterface:
TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend TYPO3\CMS\Core\Cache\Frontend\StringFrontend TYPO3\CMS\Core\Cache\Frontend\VariableFrontend TYPO3\CMS\Core\Cache\Frontend\PhpFrontend

Public Member Functions

 getIdentifier ()
 
 getBackend ()
 
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 getByTag ($tag)
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 collectGarbage ()
 
 isValidEntryIdentifier ($identifier)
 
 isValidTag ($tag)
 

Public Attributes

const TAG_CLASS = '%CLASS%'
 
const TAG_PACKAGE = '%PACKAGE%'
 
const PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
 
const PATTERN_TAG = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
 

Detailed Description

Contract for a Cache (frontend)

Definition at line 21 of file FrontendInterface.php.

Member Function Documentation

◆ collectGarbage()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::collectGarbage ( )

Does garbage collection

Returns
void

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ flush()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::flush ( )

Removes all cache entries of this cache.

Returns
void

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ flushByTag()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::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

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ get()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::get (   $entryIdentifier)

Finds and returns data from the cache.

Parameters
string$entryIdentifierSomething which identifies the cache entry - depends on concrete cache
Returns
mixed

Implemented in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend, and TYPO3\CMS\Core\Cache\Frontend\StringFrontend.

◆ getBackend()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::getBackend ( )

Returns the backend used by this cache

Returns
The backend used by this cache

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ getByTag()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::getByTag (   $tag)

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

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

Implemented in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend, and TYPO3\CMS\Core\Cache\Frontend\StringFrontend.

◆ getIdentifier()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::getIdentifier ( )

Returns this cache's identifier

Returns
string The identifier for this cache

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ has()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::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 TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ isValidEntryIdentifier()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::isValidEntryIdentifier (   $identifier)

Checks the validity of an entry identifier. Returns TRUE if it's valid.

Parameters
string$identifierAn identifier to be checked for validity
Returns
bool

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ isValidTag()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::isValidTag (   $tag)

Checks the validity of a tag. Returns TRUE if it's valid.

Parameters
string$tagA tag to be checked for validity
Returns
bool

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ remove()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::remove (   $entryIdentifier)

Removes the given cache entry from the cache.

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

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

◆ set()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::set (   $entryIdentifier,
  $data,
array  $tags = [],
  $lifetime = null 
)

Saves data in the cache.

Parameters
string$entryIdentifierSomething which identifies the data - depends on concrete cache
mixed$dataThe data to cache - also depends on the concrete cache implementation
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

Implemented in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend, TYPO3\CMS\Core\Cache\Frontend\PhpFrontend, and TYPO3\CMS\Core\Cache\Frontend\StringFrontend.

Member Data Documentation

◆ PATTERN_ENTRYIDENTIFIER

const TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'

Pattern an entry identifer must match.

Definition at line 34 of file FrontendInterface.php.

◆ PATTERN_TAG

const TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::PATTERN_TAG = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'

Pattern a tag must match.

Definition at line 38 of file FrontendInterface.php.

◆ TAG_CLASS

const TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::TAG_CLASS = '%CLASS%'

"Magic" tag for class-related entries

Definition at line 26 of file FrontendInterface.php.

◆ TAG_PACKAGE

const TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::TAG_PACKAGE = '%PACKAGE%'

"Magic" tag for package-related entries

Definition at line 30 of file FrontendInterface.php.