PHP Класс Nette\Caching\Cache

Автор: David Grudl
Наследование: extends Nette\Object, implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Nette\Caching\IStorage $storage, $namespace = NULL )
bulkLoad ( array $keys, $fallback = NULL ) : array Reads multiple items from the cache.
call ( $function ) : mixed Caches results of function/method calls.
checkCallbacks ( $callbacks ) : boolean Checks CALLBACKS dependencies.
clean ( array $conditions = NULL ) : void Removes items from the cache by conditions.
derive ( $namespace ) : self Returns new nested cache object.
getNamespace ( ) : string Returns cache namespace.
getStorage ( ) : Nette\Caching\IStorage Returns cache storage.
load ( $key, $fallback = NULL ) : mixed | null Reads the specified item from the cache or generate it.
remove ( $key ) : void Removes item from the cache.
save ( $key, $data, array $dependencies = NULL ) : mixed Writes item into the cache.
start ( $key ) : OutputHelper | null Starts the output cache.
wrap ( $function, array $dependencies = NULL ) : Closure Caches results of function/method calls.

Защищенные методы

Метод Описание
generateKey ( $key ) : string Generates internal cache key.

Приватные методы

Метод Описание
checkConst ( $const, $value ) : boolean Checks CONSTS dependency.
checkFile ( $file, $time ) : boolean Checks FILES dependency.
completeDependencies ( $dp )

Описание методов

__construct() публичный Метод

public __construct ( Nette\Caching\IStorage $storage, $namespace = NULL )
$storage Nette\Caching\IStorage

bulkLoad() публичный Метод

Reads multiple items from the cache.
public bulkLoad ( array $keys, $fallback = NULL ) : array
$keys array
Результат array

call() публичный Метод

Caches results of function/method calls.
public call ( $function ) : mixed
Результат mixed

checkCallbacks() публичный статический Метод

Checks CALLBACKS dependencies.
public static checkCallbacks ( $callbacks ) : boolean
Результат boolean

clean() публичный Метод

Conditions are: - Cache::PRIORITY => (int) priority - Cache::TAGS => (array) tags - Cache::ALL => TRUE
public clean ( array $conditions = NULL ) : void
$conditions array
Результат void

derive() публичный Метод

Returns new nested cache object.
public derive ( $namespace ) : self
Результат self

generateKey() защищенный Метод

Generates internal cache key.
protected generateKey ( $key ) : string
Результат string

getNamespace() публичный Метод

Returns cache namespace.
public getNamespace ( ) : string
Результат string

getStorage() публичный Метод

Returns cache storage.
public getStorage ( ) : Nette\Caching\IStorage
Результат Nette\Caching\IStorage

load() публичный Метод

Reads the specified item from the cache or generate it.
public load ( $key, $fallback = NULL ) : mixed | null
Результат mixed | null

remove() публичный Метод

Removes item from the cache.
public remove ( $key ) : void
Результат void

save() публичный Метод

Dependencies are: - Cache::PRIORITY => (int) priority - Cache::EXPIRATION => (timestamp) expiration - Cache::SLIDING => (bool) use sliding expiration? - Cache::TAGS => (array) tags - Cache::FILES => (array|string) file names - Cache::ITEMS => (array|string) cache items - Cache::CONSTS => (array|string) cache items
public save ( $key, $data, array $dependencies = NULL ) : mixed
$dependencies array
Результат mixed value itself

start() публичный Метод

Starts the output cache.
public start ( $key ) : OutputHelper | null
Результат OutputHelper | null

wrap() публичный Метод

Caches results of function/method calls.
public wrap ( $function, array $dependencies = NULL ) : Closure
$dependencies array
Результат Closure