TYPO3
7.6
|
Public Member Functions | |
freeze () | |
isFrozen () | |
setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) | |
set ($entryIdentifier, $data, array $tags=array(), $lifetime=null) | |
get ($entryIdentifier) | |
has ($entryIdentifier) | |
remove ($entryIdentifier) | |
findIdentifiersByTag ($searchedTag) | |
flush () | |
flushByTag ($tag) | |
collectGarbage () | |
requireOnce ($entryIdentifier) | |
Public Member Functions inherited from SimpleFileBackend | |
initializeObject () | |
setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) | |
setCacheDirectory ($cacheDirectory) | |
getCacheDirectory () | |
set ($entryIdentifier, $data, array $tags=array(), $lifetime=null) | |
get ($entryIdentifier) | |
has ($entryIdentifier) | |
remove ($entryIdentifier) | |
flush () | |
collectGarbage () | |
requireOnce ($entryIdentifier) | |
Public Member Functions inherited from AbstractBackend | |
__construct ($context, array $options=array()) | |
setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) | |
setDefaultLifetime ($defaultLifetime) | |
Public Attributes | |
const | SEPARATOR = '^' |
const | EXPIRYTIME_FORMAT = 'YmdHis' |
const | EXPIRYTIME_LENGTH = 14 |
const | DATASIZE_DIGITS = 10 |
Public Attributes inherited from SimpleFileBackend | |
const | SEPARATOR = '^' |
const | EXPIRYTIME_FORMAT = 'YmdHis' |
const | EXPIRYTIME_LENGTH = 14 |
const | DATASIZE_DIGITS = 10 |
Public Attributes inherited from AbstractBackend | |
const | DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000' |
const | UNLIMITED_LIFETIME = 0 |
Protected Member Functions | |
isCacheFileExpired ($cacheEntryPathAndFilename) | |
findCacheFilesByIdentifier ($entryIdentifier) | |
Protected Member Functions inherited from SimpleFileBackend | |
createFinalCacheDirectory ($finalCacheDirectory) | |
isCacheFileExpired ($cacheEntryPathAndFilename) | |
findCacheFilesByIdentifier ($entryIdentifier) | |
Protected Member Functions inherited from AbstractBackend | |
calculateExpiryTime ($lifetime=null) | |
Protected Attributes | |
$cacheEntryFileExtension = '' | |
$cacheEntryIdentifiers = array() | |
$frozen = false | |
Protected Attributes inherited from SimpleFileBackend | |
$cacheDirectory = '' | |
$temporaryCacheDirectory = '' | |
$cacheEntryFileExtension = '' | |
$cacheEntryIdentifiers = array() | |
$frozen = false | |
$useIgBinary = false | |
Protected Attributes inherited from AbstractBackend | |
$cache | |
$cacheIdentifier | |
$context | |
$defaultLifetime = 3600 | |
A caching backend which stores cache entries in files
This file is a backport from FLOW3
Definition at line 27 of file FileBackend.php.
collectGarbage | ( | ) |
Does garbage collection
Implements BackendInterface.
Definition at line 342 of file FileBackend.php.
References FileBackend\isCacheFileExpired().
|
protected |
Tries to find the cache entry for the specified identifier. Usually only one cache entry should be found - if more than one exist, this is due to some error or crash.
string | $entryIdentifier | The cache entry identifier |
Definition at line 370 of file FileBackend.php.
findIdentifiersByTag | ( | $searchedTag | ) |
Finds and returns all cache entry identifiers which are tagged by the specified tag.
string | $searchedTag | The tag to search for |
Implements TaggableBackendInterface.
Definition at line 259 of file FileBackend.php.
References $GLOBALS, and GeneralUtility\makeInstance().
Referenced by FileBackend\flushByTag().
flush | ( | ) |
Removes all cache entries of this cache and sets the frozen flag to FALSE.
Implements BackendInterface.
Definition at line 292 of file FileBackend.php.
flushByTag | ( | $tag | ) |
Removes all cache entries of this cache which are tagged by the specified tag.
string | $tag | The tag the entries must have |
Implements TaggableBackendInterface.
Definition at line 307 of file FileBackend.php.
References FileBackend\findIdentifiersByTag().
freeze | ( | ) |
Freezes this cache backend.
All data in a frozen backend remains unchanged and methods which try to add or modify data result in an exception thrown. Possible expiry times of individual cache entries are ignored.
On the positive side, a frozen cache backend is much faster on read access. A frozen backend can only be thawed by calling the flush() method.
\RuntimeException |
Implements FreezableBackendInterface.
Definition at line 63 of file FileBackend.php.
get | ( | $entryIdentifier | ) |
Loads data from a cache file.
string | $entryIdentifier | An identifier which describes the cache entry to load |
\InvalidArgumentException | If identifier is invalid |
Implements BackendInterface.
Definition at line 185 of file FileBackend.php.
References FileBackend\$cacheEntryFileExtension, and FileBackend\isCacheFileExpired().
has | ( | $entryIdentifier | ) |
Checks if a cache entry with the specified identifier exists.
string | $entryIdentifier |
\InvalidArgumentException |
Implements BackendInterface.
Definition at line 209 of file FileBackend.php.
References FileBackend\isCacheFileExpired().
|
protected |
Checks if the given cache entry files are still valid or if their lifetime has exceeded.
string | $cacheEntryPathAndFilename |
Definition at line 326 of file FileBackend.php.
References $GLOBALS.
Referenced by FileBackend\collectGarbage(), FileBackend\get(), FileBackend\has(), and FileBackend\requireOnce().
isFrozen | ( | ) |
Tells if this backend is frozen.
Implements FreezableBackendInterface.
Definition at line 94 of file FileBackend.php.
References FileBackend\$frozen.
remove | ( | $entryIdentifier | ) |
Removes all cache entries matching the specified identifier. Usually this only affects one entry.
string | $entryIdentifier | Specifies the cache entry to remove |
\RuntimeException | |
\InvalidArgumentException |
Implements BackendInterface.
Definition at line 230 of file FileBackend.php.
References FileBackend\$cacheEntryFileExtension.
requireOnce | ( | $entryIdentifier | ) |
Loads PHP code from the cache and require_onces it right away.
string | $entryIdentifier | An identifier which describes the cache entry to load |
\InvalidArgumentException |
Implements PhpCapableBackendInterface.
Definition at line 388 of file FileBackend.php.
References FileBackend\$cacheEntryFileExtension, and FileBackend\isCacheFileExpired().
set | ( | $entryIdentifier, | |
$data, | |||
array | $tags = array() , |
||
$lifetime = null |
|||
) |
Saves data in a cache file.
string | $entryIdentifier | An identifier for this specific cache entry |
string | $data | The data to be stored |
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. |
\RuntimeException | |
\TYPO3\CMS\Core\Cache\Exception\InvalidDataException | if the directory does not exist or is not writable or exceeds the maximum allowed path length, or if no cache frontend has been set. |
\TYPO3\CMS\Core\Cache\Exception | if the directory does not exist or is not writable or exceeds the maximum allowed path length, or if no cache frontend has been set. |
\InvalidArgumentException |
Implements BackendInterface.
Definition at line 140 of file FileBackend.php.
References FileBackend\$cacheEntryFileExtension, $GLOBALS, StringUtility\getUniqueId(), and GeneralUtility\makeInstance().
setCache | ( | \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface | $cache | ) |
Sets a reference to the cache frontend which uses this backend and initializes the default cache directory.
This method also detects if this backend is frozen and sets the internal flag accordingly.
TYPO3 v4 note: This method is different between TYPO3 v4 and FLOW3 because the Environment class to get the path to a temporary directory does not exist in v4.
\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface | $cache | The cache frontend |
Implements BackendInterface.
Definition at line 113 of file FileBackend.php.
|
protected |
Definition at line 38 of file FileBackend.php.
Referenced by FileBackend\get(), FileBackend\remove(), FileBackend\requireOnce(), and FileBackend\set().
|
protected |
Definition at line 43 of file FileBackend.php.
|
protected |
Definition at line 48 of file FileBackend.php.
Referenced by FileBackend\isFrozen().
const DATASIZE_DIGITS = 10 |
Definition at line 32 of file FileBackend.php.
const EXPIRYTIME_FORMAT = 'YmdHis' |
Definition at line 30 of file FileBackend.php.
const EXPIRYTIME_LENGTH = 14 |
Definition at line 31 of file FileBackend.php.
const SEPARATOR = '^' |
Definition at line 29 of file FileBackend.php.