TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FrontendInterface Interface Reference
Inheritance diagram for FrontendInterface:
AbstractFrontend FrontendFixture StringFrontend VariableFrontend FrontendBackendInstanceFixture FrontendDefaultFixture FrontendIdentifierFixture FrontendInitializeObjectFixture PhpFrontend FluidTemplateCache

Public Member Functions

 getIdentifier ()
 
 getBackend ()
 
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 getByTag ($tag)
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 flushByTags (array $tags)
 
 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 ( )

Does garbage collection

Returns
void

Implemented in AbstractFrontend, and FrontendFixture.

flush ( )

Removes all cache entries of this cache.

Returns
void

Implemented in AbstractFrontend, and FrontendFixture.

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 AbstractFrontend, and FrontendFixture.

flushByTags ( array  $tags)

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

Parameters
string[]$tag List of tags
Returns
void

Implemented in AbstractFrontend, and FrontendFixture.

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 VariableFrontend, StringFrontend, FrontendFixture, and FluidTemplateCache.

getBackend ( )

Returns the backend used by this cache

Returns
The backend used by this cache

Implemented in AbstractFrontend, and FrontendFixture.

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 VariableFrontend, StringFrontend, and FrontendFixture.

getIdentifier ( )

Returns this cache's identifier

Returns
string The identifier for this cache

Implemented in AbstractFrontend, and FrontendFixture.

Referenced by CacheManager\registerCache().

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 AbstractFrontend, and FrontendFixture.

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 AbstractFrontend, and FrontendFixture.

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 AbstractFrontend, and FrontendFixture.

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 AbstractFrontend, and FrontendFixture.

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 lifetime.
Returns
void

Implemented in FluidTemplateCache, PhpFrontend, FrontendFixture, StringFrontend, and VariableFrontend.

Member Data Documentation

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

Pattern an entry identifer must match.

Definition at line 34 of file FrontendInterface.php.

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

Pattern a tag must match.

Definition at line 38 of file FrontendInterface.php.

const TAG_CLASS = '%CLASS%'

"Magic" tag for class-related entries

Definition at line 26 of file FrontendInterface.php.

const TAG_PACKAGE = '%PACKAGE%'

"Magic" tag for package-related entries

Definition at line 30 of file FrontendInterface.php.