TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractFrontend Class Reference
Inheritance diagram for AbstractFrontend:
FrontendInterface StringFrontend VariableFrontend PhpFrontend FluidTemplateCache

Public Member Functions

 __construct ($identifier, BackendInterface $backend)
 
 getIdentifier ()
 
 getBackend ()
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTags (array $tags)
 
 flushByTag ($tag)
 
 collectGarbage ()
 
 isValidEntryIdentifier ($identifier)
 
 isValidTag ($tag)
 
- Public Member Functions inherited from FrontendInterface
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 getByTag ($tag)
 

Protected Attributes

 $identifier
 
 $backend
 

Additional Inherited Members

- Public Attributes inherited from FrontendInterface
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

An abstract cache

This file is a backport from FLOW3

Definition at line 28 of file AbstractFrontend.php.

Constructor & Destructor Documentation

__construct (   $identifier,
BackendInterface  $backend 
)

Constructs the cache

Parameters
string$identifierAn identifier which describes this cache
BackendInterface$backendBackend to be used for this cache
Exceptions
InvalidArgumentException if the identifier doesn't match PATTERN_ENTRYIDENTIFIER

Definition at line 49 of file AbstractFrontend.php.

References AbstractFrontend\$backend, and AbstractFrontend\$identifier.

Member Function Documentation

collectGarbage ( )

Does garbage collection

Returns
void

Implements FrontendInterface.

Definition at line 173 of file AbstractFrontend.php.

flush ( )

Removes all cache entries of this cache.

Returns
void

Implements FrontendInterface.

Definition at line 119 of file AbstractFrontend.php.

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
Exceptions
InvalidArgumentException

Implements FrontendInterface.

Definition at line 151 of file AbstractFrontend.php.

References $GLOBALS, GeneralUtility\callUserFunction(), and AbstractFrontend\isValidTag().

flushByTags ( array  $tags)

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

Parameters
string[]$tags
Returns
void
Exceptions
InvalidArgumentException

Implements FrontendInterface.

Definition at line 131 of file AbstractFrontend.php.

References AbstractFrontend\isValidTag().

getBackend ( )

Returns the backend used by this cache

Returns
BackendInterface The backend used by this cache

Implements FrontendInterface.

Definition at line 76 of file AbstractFrontend.php.

References AbstractFrontend\$backend.

getIdentifier ( )

Returns this cache's identifier

Returns
string The identifier for this cache

Implements FrontendInterface.

Definition at line 65 of file AbstractFrontend.php.

References AbstractFrontend\$identifier.

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
Exceptions
InvalidArgumentException If $entryIdentifier is invalid

Implements FrontendInterface.

Definition at line 89 of file AbstractFrontend.php.

References AbstractFrontend\isValidEntryIdentifier().

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

Implements FrontendInterface.

Definition at line 185 of file AbstractFrontend.php.

References AbstractFrontend\$identifier.

Referenced by StringFrontend\get(), VariableFrontend\get(), AbstractFrontend\has(), AbstractFrontend\remove(), VariableFrontend\set(), StringFrontend\set(), and PhpFrontend\set().

isValidTag (   $tag)

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

Parameters
string | array$tagAn identifier to be checked for validity
Returns
bool

Implements FrontendInterface.

Definition at line 197 of file AbstractFrontend.php.

Referenced by AbstractFrontend\flushByTag(), AbstractFrontend\flushByTags(), StringFrontend\getByTag(), VariableFrontend\getByTag(), VariableFrontend\set(), StringFrontend\set(), and PhpFrontend\set().

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
Exceptions
InvalidArgumentException

Implements FrontendInterface.

Definition at line 105 of file AbstractFrontend.php.

References AbstractFrontend\isValidEntryIdentifier().

Member Data Documentation

$backend
protected