PHP 클래스 Mongolid\Util\CacheComponent

상속: implements Mongolid\Util\CacheComponentInterface
파일 보기 프로젝트 열기: leroy-merlin-br/mongolid

보호된 프로퍼티들

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