PHP Класс Neos\Cache\Backend\FileBackend

Наследование: extends SimpleFileBackend, implements Neos\Cache\Backend\PhpCapableBackendInterface, implements Neos\Cache\Backend\FreezableBackendInterface, implements Neos\Cache\Backend\TaggableBackendInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cacheEntryFileExtension string A file extension to use for each cache entry.
$cacheEntryIdentifiers array
$frozen boolean

Открытые методы

Метод Описание
collectGarbage ( ) : void Does garbage collection
findIdentifiersByTag ( string $searchedTag ) : array Finds and returns all cache entry identifiers which are tagged by the specified tag.
flush ( ) : void Removes all cache entries of this cache and sets the frozen flag to FALSE.
flushByTag ( string $tag ) : integer Removes all cache entries of this cache which are tagged by the specified tag.
freeze ( ) : void Freezes this cache backend.
get ( string $entryIdentifier ) : mixed Loads data from a cache file.
has ( string $entryIdentifier ) : boolean Checks if a cache entry with the specified identifier exists.
isFrozen ( ) : boolean Tells if this backend is frozen.
remove ( string $entryIdentifier ) : boolean Removes all cache entries matching the specified identifier.
requireOnce ( string $entryIdentifier ) : mixed Loads PHP code from the cache and require_onces it right away.
set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void Saves data in a cache file.
setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void Sets a reference to the cache frontend which uses this backend and initializes the default cache directory.

Защищенные методы

Метод Описание
findCacheFilesByIdentifier ( string $entryIdentifier ) : mixed Tries to find the cache entry for the specified identifier.
internalGet ( string $entryIdentifier, boolean $acquireLock = true ) : boolean | string Internal get method, allows to nest locks by using the $acquireLock flag
isCacheFileExpired ( string $cacheEntryPathAndFilename, boolean $acquireLock = true ) : boolean Checks if the given cache entry files are still valid or if their lifetime has exceeded.

Описание методов

collectGarbage() публичный Метод

Does garbage collection
public collectGarbage ( ) : void
Результат void

findCacheFilesByIdentifier() защищенный Метод

Usually only one cache entry should be found - if more than one exist, this is due to some error or crash.
protected findCacheFilesByIdentifier ( string $entryIdentifier ) : mixed
$entryIdentifier string The cache entry identifier
Результат mixed The filenames (including path) as an array if one or more entries could be found, otherwise FALSE

findIdentifiersByTag() публичный Метод

Finds and returns all cache entry identifiers which are tagged by the specified tag.
public findIdentifiersByTag ( string $searchedTag ) : array
$searchedTag string The tag to search for
Результат array An array with identifiers of all matching entries. An empty array if no entries matched

flush() публичный Метод

Removes all cache entries of this cache and sets the frozen flag to FALSE.
public flush ( ) : void
Результат void

flushByTag() публичный Метод

Removes all cache entries of this cache which are tagged by the specified tag.
public flushByTag ( string $tag ) : integer
$tag string The tag the entries must have
Результат integer The number of entries which have been affected by this flush

freeze() публичный Метод

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.
public freeze ( ) : void
Результат void

get() публичный Метод

Loads data from a cache file.
public get ( string $entryIdentifier ) : mixed
$entryIdentifier string An identifier which describes the cache entry to load
Результат mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded

has() публичный Метод

Checks if a cache entry with the specified identifier exists.
public has ( string $entryIdentifier ) : boolean
$entryIdentifier string
Результат boolean TRUE if such an entry exists, FALSE if not

internalGet() защищенный Метод

Internal get method, allows to nest locks by using the $acquireLock flag
protected internalGet ( string $entryIdentifier, boolean $acquireLock = true ) : boolean | string
$entryIdentifier string
$acquireLock boolean
Результат boolean | string

isCacheFileExpired() защищенный Метод

Checks if the given cache entry files are still valid or if their lifetime has exceeded.
protected isCacheFileExpired ( string $cacheEntryPathAndFilename, boolean $acquireLock = true ) : boolean
$cacheEntryPathAndFilename string
$acquireLock boolean
Результат boolean

isFrozen() публичный Метод

Tells if this backend is frozen.
public isFrozen ( ) : boolean
Результат boolean

remove() публичный Метод

Usually this only affects one entry.
public remove ( string $entryIdentifier ) : boolean
$entryIdentifier string Specifies the cache entry to remove
Результат boolean TRUE if (at least) an entry could be removed or FALSE if no entry was found

requireOnce() публичный Метод

Loads PHP code from the cache and require_onces it right away.
public requireOnce ( string $entryIdentifier ) : mixed
$entryIdentifier string An identifier which describes the cache entry to load
Результат mixed Potential return value from the include operation

set() публичный Метод

Saves data in a cache file.
public set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void
$entryIdentifier string An identifier for this specific cache entry
$data string The data to be stored
$tags array Tags to associate with this cache entry
$lifetime integer Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Результат void

setCache() публичный Метод

This method also detects if this backend is frozen and sets the internal flag accordingly.
public setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void
$cache Neos\Cache\Frontend\FrontendInterface The cache frontend
Результат void

Описание свойств

$cacheEntryFileExtension защищенное свойство

A file extension to use for each cache entry.
protected string $cacheEntryFileExtension
Результат string

$cacheEntryIdentifiers защищенное свойство

protected array $cacheEntryIdentifiers
Результат array

$frozen защищенное свойство

protected bool $frozen
Результат boolean