PHP Интерфейс PDepend\Util\Cache\CacheDriver

С версии: 0.10.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