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

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

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

Свойство Тип Описание
$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