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
파일 보기 프로젝트 열기: unionofrad/lithium

보호된 프로퍼티들

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