PHP 클래스 Neos\Cache\Backend\SimpleFileBackend

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

보호된 프로퍼티들

프로퍼티 타입 설명
$baseDirectory string If not given this will be determined by the EnvironmentConfiguration
$cacheDirectory string Directory where the files are stored.
$cacheEntryFileExtension string A file extension to use for each cache entry.
$cacheEntryIdentifiers array
$cacheFilesIterator DirectoryIterator
$frozen boolean
$useIgBinary boolean Caching the result of extension_loaded() here is faster than calling extension_loaded() multiple times.

공개 메소드들

메소드 설명
__construct ( EnvironmentConfiguration $environmentConfiguration, array $options = [] )
collectGarbage ( ) : void Not necessary
current ( ) : mixed Returns the data of the current cache entry pointed to by the cache entry iterator.
flush ( ) : void Removes all cache entries of this cache.
get ( string $entryIdentifier ) : mixed Loads data from a cache file.
getBaseDirectory ( ) : string
getCacheDirectory ( ) : string Returns the directory where the cache files are stored
has ( string $entryIdentifier ) : boolean Checks if a cache entry with the specified identifier exists.
key ( ) : string Returns the identifier of the current cache entry pointed to by the cache entry iterator.
next ( ) : void Move forward to the next cache entry
remove ( string $entryIdentifier ) : boolean Removes all cache entries matching the specified identifier.
requireOnce ( string $entryIdentifier ) : mixed Loads PHP code from the cache and include_onces it right away.
rewind ( ) : void Rewinds the cache entry iterator to the first element
set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void Saves data in a cache file.
setBaseDirectory ( string $baseDirectory )
setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void Sets a reference to the cache frontend which uses this backend and initializes the default cache directory.
setCacheDirectory ( string $cacheDirectory ) : void Sets the directory where the cache files are stored
valid ( ) : boolean Checks if the current position of the cache entry iterator is valid

보호된 메소드들

메소드 설명
configureCacheDirectory ( )
findCacheFilesByIdentifier ( string $entryIdentifier ) : mixed Tries to find the cache entry for the specified identifier.
isCacheFileExpired ( string $cacheEntryPathAndFilename ) : boolean Checks if the given cache entry files are still valid or if their lifetime has exceeded.
readCacheFile ( string $cacheEntryPathAndFilename, integer | null $offset = null, integer | null $maxlen = null ) : boolean | string Reads the cache data from the given cache file, using locking.
throwExceptionIfPathExceedsMaximumLength ( string $cacheEntryPathAndFilename ) : void
writeCacheFile ( string $cacheEntryPathAndFilename, string $data ) : boolean | integer Writes the cache data into the given cache file, using locking.

메소드 상세

__construct() 공개 메소드

public __construct ( EnvironmentConfiguration $environmentConfiguration, array $options = [] )
$environmentConfiguration Neos\Cache\EnvironmentConfiguration
$options array

collectGarbage() 공개 메소드

Not necessary
public collectGarbage ( ) : void
리턴 void

configureCacheDirectory() 보호된 메소드

protected configureCacheDirectory ( )

current() 공개 메소드

Returns the data of the current cache entry pointed to by the cache entry iterator.
public current ( ) : mixed
리턴 mixed

findCacheFilesByIdentifier() 보호된 메소드

Tries to find the cache entry for the specified identifier.
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

flush() 공개 메소드

Removes all cache entries of this cache.
public flush ( ) : 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

getBaseDirectory() 공개 메소드

public getBaseDirectory ( ) : string
리턴 string

getCacheDirectory() 공개 메소드

Returns the directory where the cache files are stored
public getCacheDirectory ( ) : string
리턴 string Full path of the cache directory

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

isCacheFileExpired() 보호된 메소드

Checks if the given cache entry files are still valid or if their lifetime has exceeded.
protected isCacheFileExpired ( string $cacheEntryPathAndFilename ) : boolean
$cacheEntryPathAndFilename string
리턴 boolean

key() 공개 메소드

Returns the identifier of the current cache entry pointed to by the cache entry iterator.
public key ( ) : string
리턴 string

next() 공개 메소드

Move forward to the next cache entry
public next ( ) : void
리턴 void

readCacheFile() 보호된 메소드

Reads the cache data from the given cache file, using locking.
protected readCacheFile ( string $cacheEntryPathAndFilename, integer | null $offset = null, integer | null $maxlen = null ) : boolean | string
$cacheEntryPathAndFilename string
$offset integer | null
$maxlen integer | null
리턴 boolean | string The contents of the cache file or FALSE on error

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 include_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

rewind() 공개 메소드

Rewinds the cache entry iterator to the first element
public rewind ( ) : void
리턴 void

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 Ignored in this type of cache backend
$lifetime integer Ignored in this type of cache backend
리턴 void

setBaseDirectory() 공개 메소드

public setBaseDirectory ( string $baseDirectory )
$baseDirectory string

setCache() 공개 메소드

Sets a reference to the cache frontend which uses this backend and initializes the default cache directory.
public setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void
$cache Neos\Cache\Frontend\FrontendInterface The cache frontend
리턴 void

setCacheDirectory() 공개 메소드

Sets the directory where the cache files are stored
public setCacheDirectory ( string $cacheDirectory ) : void
$cacheDirectory string Full path of the cache directory
리턴 void

throwExceptionIfPathExceedsMaximumLength() 보호된 메소드

protected throwExceptionIfPathExceedsMaximumLength ( string $cacheEntryPathAndFilename ) : void
$cacheEntryPathAndFilename string
리턴 void

valid() 공개 메소드

Checks if the current position of the cache entry iterator is valid
public valid ( ) : boolean
리턴 boolean TRUE if the current position is valid, otherwise FALSE

writeCacheFile() 보호된 메소드

Writes the cache data into the given cache file, using locking.
protected writeCacheFile ( string $cacheEntryPathAndFilename, string $data ) : boolean | integer
$cacheEntryPathAndFilename string
$data string
리턴 boolean | integer Return value of file_put_contents

프로퍼티 상세

$baseDirectory 보호되어 있는 프로퍼티

If not given this will be determined by the EnvironmentConfiguration
protected string $baseDirectory
리턴 string

$cacheDirectory 보호되어 있는 프로퍼티

Directory where the files are stored.
protected string $cacheDirectory
리턴 string

$cacheEntryFileExtension 보호되어 있는 프로퍼티

A file extension to use for each cache entry.
protected string $cacheEntryFileExtension
리턴 string

$cacheEntryIdentifiers 보호되어 있는 프로퍼티

protected array $cacheEntryIdentifiers
리턴 array

$cacheFilesIterator 보호되어 있는 프로퍼티

protected DirectoryIterator $cacheFilesIterator
리턴 DirectoryIterator

$frozen 보호되어 있는 프로퍼티

protected bool $frozen
리턴 boolean

$useIgBinary 보호되어 있는 프로퍼티

Caching the result of extension_loaded() here is faster than calling extension_loaded() multiple times.
protected bool $useIgBinary
리턴 boolean