TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Cache\Frontend\VariableFrontend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Frontend\VariableFrontend:
TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend TYPO3\CMS\Core\Cache\Frontend\FrontendInterface

Public Member Functions

 initializeObject ()
 
 set ($entryIdentifier, $variable, array $tags=[], $lifetime=null)
 
 get ($entryIdentifier)
 
 getByTag ($tag)
 
- Public Member Functions inherited from TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
 __construct ($identifier, BackendInterface $backend)
 
 getIdentifier ()
 
 getBackend ()
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 collectGarbage ()
 
 isValidEntryIdentifier ($identifier)
 
 isValidTag ($tag)
 

Protected Attributes

 $useIgBinary = false
 
- Protected Attributes inherited from TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
 $identifier
 
 $backend
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Core\Cache\Frontend\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

A cache frontend for any kinds of PHP variables

This file is a backport from FLOW3

Definition at line 26 of file VariableFrontend.php.

Member Function Documentation

◆ get()

TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::get (   $entryIdentifier)

Finds and returns a variable value from the cache.

Parameters
string$entryIdentifierIdentifier of the cache entry to fetch
Returns
mixed The value
Exceptions

Implements TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Definition at line 98 of file VariableFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidEntryIdentifier().

◆ getByTag()

TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::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

Implements TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Definition at line 123 of file VariableFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$identifier, and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidTag().

◆ initializeObject()

TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::initializeObject ( )

Initializes this cache frontend

Returns
void

Definition at line 41 of file VariableFrontend.php.

◆ set()

TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::set (   $entryIdentifier,
  $variable,
array  $tags = [],
  $lifetime = null 
)

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

Parameters
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 liftime.
Returns
void
Exceptions

Implements TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Definition at line 58 of file VariableFrontend.php.

References $GLOBALS, $params, TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidEntryIdentifier(), and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidTag().

Member Data Documentation

◆ $useIgBinary

TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::$useIgBinary = false
protected

Definition at line 34 of file VariableFrontend.php.