PHP Класс Mongolid\Util\CacheComponent

Наследование: implements Mongolid\Util\CacheComponentInterface
Показать файл Открыть проект

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

Свойство Тип Описание
$storage array The array of stored values.
$ttl array Time to live of each stored value.

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

Метод Описание
get ( string $key ) : mixed Retrieve an item from the cache by key.
has ( string $key ) : boolean Determine if an item exists in the cache. This method will also check if the ttl of the given cache key has been expired and will free the memory if so.
put ( string $key, mixed $value, float $minutes ) : void Store an item in the cache for a given number of minutes.

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

Метод Описание
time ( ) : integer Return the current time in order to check ttl.

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

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

Retrieve an item from the cache by key.
public get ( string $key ) : mixed
$key string Cache key of the item to be retrieved.
Результат mixed

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

Determine if an item exists in the cache. This method will also check if the ttl of the given cache key has been expired and will free the memory if so.
public has ( string $key ) : boolean
$key string Cache key of the item.
Результат boolean Has cache key.

put() публичный метод

Store an item in the cache for a given number of minutes.
public put ( string $key, mixed $value, float $minutes ) : void
$key string Cache key of the item.
$value mixed Value being stored in cache.
$minutes float Cache ttl.
Результат void

time() защищенный метод

Return the current time in order to check ttl.
protected time ( ) : integer
Результат integer Return current Unix timestamp.

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

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

The array of stored values.
protected array $storage
Результат array

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

Time to live of each stored value.
protected array $ttl
Результат array