TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
AbstractFrontend Class Reference
Inheritance diagram for AbstractFrontend:
FrontendInterface StringFrontend VariableFrontend PhpFrontend

Public Member Functions

 __construct ($identifier, BackendInterface $backend)
 
 getIdentifier ()
 
 getBackend ()
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 collectGarbage ()
 
 isValidEntryIdentifier ($identifier)
 
 isValidTag ($tag)
 
- Public Member Functions inherited from FrontendInterface
 set ($entryIdentifier, $data, array $tags=array(), $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
\InvalidArgumentExceptionif 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 154 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 132 of file AbstractFrontend.php.

References $GLOBALS, GeneralUtility\callUserFunction(), and 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
\InvalidArgumentExceptionIf $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 166 of file AbstractFrontend.php.

References AbstractFrontend\$identifier.

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

isValidTag (   $tag)

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

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

Implements FrontendInterface.

Definition at line 178 of file AbstractFrontend.php.

Referenced by AbstractFrontend\flushByTag(), StringFrontend\getByTag(), VariableFrontend\getByTag(), StringFrontend\set(), PhpFrontend\set(), and VariableFrontend\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
$identifier
protected