All Classes Namespaces Files Functions Variables Pages
VariableFrontend Class Reference
Inheritance diagram for VariableFrontend:
AbstractFrontend FrontendInterface

Public Member Functions

 set ($entryIdentifier, $variable, 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 PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
const PATTERN_TAG = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
- Protected Attributes inherited from AbstractFrontend

Detailed Description

A cache frontend for any kinds of PHP variables

Definition at line 23 of file VariableFrontend.php.

Member Function Documentation

get (   $entryIdentifier)

Finds and returns a variable value from the cache.

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

Implements FrontendInterface.

Definition at line 76 of file VariableFrontend.php.

References AbstractFrontend\isValidEntryIdentifier().

getByTag (   $tag)

Finds and returns all cache entries which are tagged by the specified tag.

string$tagThe tag to search for
array An array with the content of all matching entries. An empty array if no entries matched
InvalidArgumentException if the tag is not valid

Implements FrontendInterface.

Definition at line 101 of file VariableFrontend.php.

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

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

Saves the value of a PHP variable in the cache. Note that the variable will be serialized if necessary.

string$entryIdentifierAn identifier used for this cache entry
mixed$variableThe 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.
InvalidArgumentException if the identifier or tag is not valid

Implements FrontendInterface.

Definition at line 37 of file VariableFrontend.php.

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