‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Cache\Frontend\PhpFrontend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Frontend\PhpFrontend:
TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend TYPO3\CMS\Core\Cache\Frontend\FrontendInterface TYPO3\CMS\Core\Cache\Frontend\NullFrontend

Public Member Functions

 __construct ($identifier, PhpCapableBackendInterface $backend)
 
 set ($entryIdentifier, $sourceCode, array $tags=[], $lifetime=null)
 
string get ($entryIdentifier)
 
mixed requireOnce ($entryIdentifier)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
 __construct ($identifier, BackendInterface $backend)
 
string getIdentifier ()
 
BackendInterface getBackend ()
 
bool has ($entryIdentifier)
 
bool remove ($entryIdentifier)
 
 flush ()
 
 flushByTags (array $tags)
 
 flushByTag ($tag)
 
 collectGarbage ()
 
bool isValidEntryIdentifier ($identifier)
 
bool isValidTag ($tag)
 

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}$/'
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
string $identifier
 
BackendInterface TaggableBackendInterface $backend
 

Detailed Description

A cache frontend tailored to PHP code.

Definition at line 24 of file PhpFrontend.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::__construct (   $identifier,
PhpCapableBackendInterface  $backend 
)

Constructs the cache

Parameters
string$identifier‪An identifier which describes this cache
PhpCapableBackendInterface$backendBackend to be used for this cache

Definition at line 32 of file PhpFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$backend, and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$identifier.

Member Function Documentation

◆ get()

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

Finds and returns a variable value from the cache.

Parameters
string$entryIdentifier‪Identifier of the cache entry to fetch
Returns
‪string The value
Exceptions

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

Definition at line 71 of file PhpFrontend.php.

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

◆ requireOnce()

mixed TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::requireOnce (   $entryIdentifier)

Loads PHP code from the cache and require_onces it right away.

Parameters
string$entryIdentifier‪An identifier which describes the cache entry to load
Returns
‪mixed Potential return value from the include operation

Definition at line 85 of file PhpFrontend.php.

◆ set()

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

Saves the PHP source code in the cache.

Parameters
string$entryIdentifier‪An identifier used for this cache entry, for example the class name
string$sourceCode‪PHP source code
array$tags‪Tags to associate with this cache entry
int$lifetime‪Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Exceptions

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

Reimplemented in TYPO3\CMS\Core\Cache\Frontend\NullFrontend.

Definition at line 47 of file PhpFrontend.php.

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