‪TYPO3CMS  ‪main
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\Tests\Unit\Cache\Fixtures\FrontendFixture TYPO3\CMS\Core\Cache\Frontend\PhpFrontend TYPO3\CMS\Core\Cache\Frontend\VariableFrontend TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendBackendInstanceFixture TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendDefaultFixture TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendIdentifierFixture TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendInitializeObjectFixture TYPO3\CMS\Core\Cache\Frontend\NullFrontend

Public Member Functions

string getIdentifier ()
 
TYPO3 CMS Core Cache Backend BackendInterface getBackend ()
 
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
mixed get ($entryIdentifier)
 
bool has ($entryIdentifier)
 
bool remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 flushByTags (array $tags)
 
 collectGarbage ()
 
bool isValidEntryIdentifier ($identifier)
 
bool 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 ( )

◆ flush()

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

◆ 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$tag‪The tag the entries must have

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ flushByTags()

TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::flushByTags ( array  $tags)

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

Parameters
string[]$tags‪List of tags

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ get()

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

Finds and returns data from the cache.

Parameters
string$entryIdentifier‪Something which identifies the cache entry - depends on concrete cache
Returns
‪mixed

Implemented in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend, TYPO3\CMS\Core\Cache\Frontend\PhpFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

Referenced by TYPO3\CMS\Core\Security\ContentSecurityPolicy\HashProxy\compileHashValues().

◆ getBackend()

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

Returns the backend used by this cache

Returns
‪\TYPO3\CMS\Core\Cache\Backend\BackendInterface The backend used by this cache

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ getIdentifier()

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

◆ has()

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

Checks if a cache entry with the specified identifier exists.

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

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ isValidEntryIdentifier()

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

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

Parameters
string$identifier‪An identifier to be checked for validity
Returns
‪bool

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ isValidTag()

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

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

Parameters
string$tag‪A tag to be checked for validity
Returns
‪bool

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ remove()

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

Removes the given cache entry from the cache.

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

Implemented in TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

◆ set()

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

Saves data in the cache.

Parameters
string$entryIdentifier‪Something which identifies the data - depends on concrete cache
mixed$data‪The data to cache - also depends on the concrete cache implementation
array$tags‪Tags to associate with this cache entry
int$lifetime‪Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.

Implemented in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend, TYPO3\CMS\Core\Cache\Frontend\PhpFrontend, TYPO3\CMS\Core\Cache\Frontend\NullFrontend, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\FrontendFixture.

Referenced by TYPO3\CMS\Core\Security\ContentSecurityPolicy\HashProxy\compileHashValues().

Member Data Documentation

◆ PATTERN_ENTRYIDENTIFIER

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

Pattern an entry identifier 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.