PHP Класс lithium\storage\cache\adapter\Memory

This Memory adapter provides basic support for write, read, delete and clear cache functionality, as well as allowing the first four methods to be filtered as per the Lithium filtering system. This cache adapter does not implement any expiry-based cache invalidation logic, as the cached data will only persist for the lifetime of the current request. As a result, this cache adapter is best suited for generic memoization of data, and should not be used for for anything that must persist longer than the current request cycle.
Наследование: extends lithium\core\Object
Показать файл Открыть проект

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

Свойство Тип Описание
$_cache array Array used to store cached data by this adapter

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

Метод Описание
__get ( string $variable ) : mixed Magic method to provide an accessor (getter) to protected class variables.
clear ( ) : boolean Clears entire cache by flushing it. All cache keys using the configuration but *without* honoring the scope are removed.
decrement ( string $key, integer $offset = 1 ) : integer | boolean Performs a decrement operation on specified numeric cache item.
delete ( array $keys ) : boolean Will attempt to remove specified keys from the user space cache.
increment ( string $key, integer $offset = 1 ) : integer | boolean Performs an increment operation on specified numeric cache item.
read ( array $keys ) : array Read values from the cache. Will attempt to return an array of data containing key/value pairs of the requested data.
write ( array $keys, null | string $expiry = null ) : boolean Write values to the cache.

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

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

Magic method to provide an accessor (getter) to protected class variables.
public __get ( string $variable ) : mixed
$variable string The variable requested.
Результат mixed Variable if it exists, null otherwise.

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

The operation will continue to remove keys even if removing one single key fails, clearing thoroughly as possible. In any case this method will return true.
public clear ( ) : boolean
Результат boolean Always returns `true`.

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

Performs a decrement operation on specified numeric cache item.
public decrement ( string $key, integer $offset = 1 ) : integer | boolean
$key string Key of numeric cache item to decrement.
$offset integer Offset to decrement - defaults to `1`.
Результат integer | boolean The item's new value on successful decrement, else `false`.

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

Will attempt to remove specified keys from the user space cache.
public delete ( array $keys ) : boolean
$keys array Keys to uniquely identify the cached items.
Результат boolean `true` on successful delete, `false` otherwise.

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

Performs an increment operation on specified numeric cache item.
public increment ( string $key, integer $offset = 1 ) : integer | boolean
$key string Key of numeric cache item to increment.
$offset integer Offset to increment - defaults to `1`.
Результат integer | boolean The item's new value on successful increment, else `false`.

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

Read values from the cache. Will attempt to return an array of data containing key/value pairs of the requested data.
public read ( array $keys ) : array
$keys array Keys to uniquely identify the cached items.
Результат array Cached values keyed by cache keys on successful read, keys which could not be read will not be included in the results array.

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

Write values to the cache.
public write ( array $keys, null | string $expiry = null ) : boolean
$keys array Key/value pairs with keys to uniquely identify the to-be-cached item.
$expiry null | string Unused.
Результат boolean `true` on successful write, `false` otherwise.

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

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

Array used to store cached data by this adapter
protected array $_cache
Результат array