PHP 클래스 Neos\Cache\Backend\FileBackend

상속: extends SimpleFileBackend, implements Neos\Cache\Backend\PhpCapableBackendInterface, implements Neos\Cache\Backend\FreezableBackendInterface, implements Neos\Cache\Backend\TaggableBackendInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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