Class Cache (namespace Nette\Caching)


Implements the cache for a application.

Object
   |
   --Cache

Implements interfaces:

ArrayAccess (internal interface)
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Caching/Cache.php (line 36)
Constructor Summary
public
__construct (ICacheStorage $storage, [$namespace = NULL])
Method Summary
void
clean ([$conds = NULL])
Removes items from the cache by conditions.
string
Returns cache namespace.
ICacheStorage
Returns cache storage.
bool
offsetExists (string $key)
Exists item in cache? (\ArrayAccess implementation).
mixed|NULL
offsetGet (string $key)
Retrieves the specified item from the cache or NULL if the key is not found (\ArrayAccess implementation).
void
offsetSet (string $key, mixed $data)
Inserts (replaces) item into the cache (\ArrayAccess implementation).
void
offsetUnset (string $key)
Removes the specified item from the cache.
void
release ()
Discards the internal cache.
void
save (string $key, mixed $data, [$dependencies = NULL])
Writes item into the cache.
Methods Inherited From Object
Object::extensionMethod(), Object::getClass(), Object::getReflection(), Object::__call(), Object::__callStatic(), Object::__get(), Object::__isset(), Object::__set(), Object::__unset()
Constant Summary
string ALL 'all'

line 46

dependency
string CONSTS 'consts'

line 45

dependency
string EXPIRE 'expire'

line 40

dependency
string FILES 'files'

line 43

dependency
string ITEMS 'items'

line 44

dependency
string PRIORITY 'priority'

line 39

dependency
string REFRESH 'refresh'

line 41

dependency
string TAGS 'tags'

line 42

dependency

Constructor Details

line 63

__construct

public __construct (ICacheStorage $storage, [$namespace = NULL])

Input
ICacheStorage $storage
$namespace
Method Details

line 145

clean

public void clean ([$conds = NULL])

Removes items from the cache by conditions.

Input
$conds
Output
void  

line 86

getNamespace

public string getNamespace ()

Returns cache namespace.

Output
string  

line 75

getStorage

public ICacheStorage getStorage ()

Returns cache storage.

Output
ICacheStorage  

line 236

offsetExists

public bool offsetExists (string $key)

Exists item in cache? (\ArrayAccess implementation).

Implementation of:

ArrayAccess::offsetExists
Input
string $key key
Output
bool  
Throws
throws InvalidArgumentException

line 214

offsetGet

public mixed|NULL offsetGet (string $key)

Retrieves the specified item from the cache or NULL if the key is not found (\ArrayAccess implementation).

Implementation of:

ArrayAccess::offsetGet
Input
string $key key
Output
mixed|NULL  
Throws
throws InvalidArgumentException

line 192

offsetSet

public void offsetSet (string $key, mixed $data)

Inserts (replaces) item into the cache (\ArrayAccess implementation).

Implementation of:

ArrayAccess::offsetSet
Input
string $key key
mixed $data
Output
void  
Throws
throws InvalidArgumentException

line 255

offsetUnset

public void offsetUnset (string $key)

Removes the specified item from the cache.

Implementation of:

ArrayAccess::offsetUnset
Input
string $key key
Output
void  
Throws
throws InvalidArgumentException

line 97

release

public void release ()

Discards the internal cache.

Output
void  

line 121

save

public void save (string $key, mixed $data, [$dependencies = NULL])

Writes item into the cache.

Dependencies are: priority => (int) priority expire => (timestamp) expiration refresh => (bool) use sliding expiration? tags => (array) tags files => (array|string) file names items => (array|string) cache items consts => (array|string) cache items

Input
string $key key
mixed $data
$dependencies
Output
void  
Throws
throws InvalidArgumentException