PHP 인터페이스 Elgg\Cache\Pool

Exactly how/when the values are invalidated is not specified by this API, except that specific values can be forcefully invalidated with ::invalidate(). WARNING: API IN FLUX. DO NOT USE DIRECTLY.
부터: 1.10.0
파일 보기 프로젝트 열기: elgg/elgg 0 사용 예제들

공개 메소드들

메소드 설명
get ( string | integer $key, callable $callback = null, mixed $default = null ) : mixed Fetches a value from the cache, with the option of calculating on miss
invalidate ( string | integer $key ) : void Forcefully invalidates the value associated with the given key.
put ( string | integer $key, mixed $value ) : void Prime the cache to a specific value.

메소드 상세

get() 공개 메소드

Fetches a value from the cache, with the option of calculating on miss
public get ( string | integer $key, callable $callback = null, mixed $default = null ) : mixed
$key string | integer A plain string ID for the cache entry
$callback callable Logic for calculating the cache entry on miss
$default mixed Default value returned if the value is missing and no callback is provided
리턴 mixed The cache value or the $default if no value and no callable

invalidate() 공개 메소드

Implementations must: * Immediately consider the value stale * Recalculate the value at the next opportunity
public invalidate ( string | integer $key ) : void
$key string | integer A plain string ID for the cache entry to invalidate.
리턴 void

put() 공개 메소드

This is useful when the value was calculated by some out-of-band means. For example, when a list of rows is fetched from the database, you can prime the cache for each individual result.
public put ( string | integer $key, mixed $value ) : void
$key string | integer A plain string ID for the cache entry
$value mixed The cache value
리턴 void