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

Public Member Functions

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

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}$/'
 
- Protected Attributes inherited from AbstractFrontend
 $identifier
 
 $backend
 

Detailed Description

A cache frontend for strings. Nothing else.

This file is a backport from FLOW3

Definition at line 25 of file StringFrontend.php.

Member Function Documentation

get (   $entryIdentifier)

Finds and returns a variable value from the cache.

Parameters
string$entryIdentifierIdentifier of the cache entry to fetch
Returns
string The value
Exceptions
InvalidArgumentException if the cache identifier is not valid

Implements FrontendInterface.

Definition at line 63 of file StringFrontend.php.

References AbstractFrontend\isValidEntryIdentifier().

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
Exceptions
InvalidArgumentException if the tag is not valid

Implements FrontendInterface.

Definition at line 79 of file StringFrontend.php.

References AbstractFrontend\$identifier, and AbstractFrontend\isValidTag().

set (   $entryIdentifier,
  $string,
array  $tags = [],
  $lifetime = null 
)

Saves the value of a PHP variable in the cache.

Parameters
string$entryIdentifierAn identifier used for this cache entry
string$stringThe variable to cache
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
Exceptions
InvalidArgumentException if the identifier or tag is not valid
InvalidDataExceptionif the variable to cache is not of type string

Implements FrontendInterface.

Definition at line 39 of file StringFrontend.php.

References AbstractFrontend\isValidEntryIdentifier(), and AbstractFrontend\isValidTag().