PHP 인터페이스 PDepend\Util\Cache\CacheDriver

부터: 0.10.0
파일 보기 프로젝트 열기: pdepend/pdepend 0 사용 예제들

공개 메소드들

메소드 설명
remove ( string $pattern ) : void This method will remove an existing cache entry for the given identifier.
restore ( string $key, string $hash = null ) : mixed This method tries to restore an existing cache entry for the given $key. If a matching entry exists, this method verifies that the given $hash and the the value stored with cache entry are equal.
store ( string $key, mixed $data, string $hash = null ) : void This method will store the given $data under $key. This method can be called with a third parameter that will be used as a verification token, when the a cache entry gets restored. If the stored hash and the supplied hash are not identical, that cache entry will be removed and not returned.
type ( string $type ) : PDepend\Util\Cache\CacheDriver Sets the type for the next store() or restore() method call. A type is something like a namespace or group for cache entries.

메소드 상세

remove() 공개 메소드

It will delete all cache entries where the cache key start with the given $pattern. If no matching entry exists, this method simply does nothing.
public remove ( string $pattern ) : void
$pattern string The cache key pattern.
리턴 void

restore() 공개 메소드

Then it returns the cached entry. Otherwise this method will return NULL.
public restore ( string $key, string $hash = null ) : mixed
$key string The cache key for the given data.
$hash string Optional hash that will be used for verification.
리턴 mixed

store() 공개 메소드

This method will store the given $data under $key. This method can be called with a third parameter that will be used as a verification token, when the a cache entry gets restored. If the stored hash and the supplied hash are not identical, that cache entry will be removed and not returned.
public store ( string $key, mixed $data, string $hash = null ) : void
$key string The cache key for the given data.
$data mixed Any data that should be cached.
$hash string Optional hash that will be used for verification.
리턴 void

type() 공개 메소드

Note that the cache type will be reset after each storage method call, so you must invoke right before every call to restore() or store().
public type ( string $type ) : PDepend\Util\Cache\CacheDriver
$type string
리턴 PDepend\Util\Cache\CacheDriver