Cache
class Cache extends Object implements ArrayAccess
Implements the cache for a application.
Constants
PRIORITY |
dependency |
EXPIRATION |
dependency |
EXPIRE |
dependency |
SLIDING |
dependency |
TAGS |
dependency |
FILES |
dependency |
ITEMS |
dependency |
CONSTS |
dependency |
CALLBACKS |
dependency |
ALL |
dependency |
internal NAMESPACE_SEPARATOR |
|
Methods
Returns cache storage.
Returns cache namespace.
Reads the specified item from the cache or generate it.
Writes item into the cache.
Removes item from the cache.
Removes items from the cache by conditions.
Caches results of function/method calls.
Starts the output cache.
Generates internal cache key.
Checks CALLBACKS dependencies.
Details
at line 47
__construct(IStorage $storage, $namespace = NULL)
No description
at line 58
IStorage
getStorage()
Returns cache storage.
at line 68
string
getNamespace()
Returns cache namespace.
at line 79
Cache
derive($namespace)
Returns new nested cache object.
at line 92
mixed|null
load($key, $fallback = NULL)
Reads the specified item from the cache or generate it.
at line 121
mixed
save($key, $data, array $dependencies = NULL)
Writes item into the cache.
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
at line 193
void
remove($key)
Removes item from the cache.
at line 207
void
clean(array $conditions = NULL)
Removes items from the cache by conditions.
Conditions are:
- Cache::PRIORITY => (int) priority
- Cache::TAGS => (array) tags
- Cache::ALL => TRUE
at line 223
mixed
call($function)
Caches results of function/method calls.
at line 241
Closure
wrap($function, array $dependencies = NULL)
Caches results of function/method calls.
at line 262
OutputHelper|null
start($key)
Starts the output cache.
at line 278
protected string
generateKey($key)
Generates internal cache key.
at line 290
offsetSet($key, $data)
deprecated
deprecated
No description
at line 300
offsetGet($key)
deprecated
deprecated
No description
at line 315
offsetExists($key)
deprecated
deprecated
No description
at line 326
offsetUnset($key)
deprecated
deprecated
No description
at line 336
release()
deprecated
deprecated
No description
at line 351
static bool
checkCallbacks($callbacks)
Checks CALLBACKS dependencies.