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 188
void
remove($key)
Removes item from the cache.
at line 202
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 214
mixed
call($function)
Caches results of function/method calls.
at line 232
Closure
wrap($function, array $dependencies = NULL)
Caches results of function/method calls.
at line 254
OutputHelper|null
start($key)
Starts the output cache.
at line 270
protected string
generateKey($key)
Generates internal cache key.
at line 282
offsetSet($key, $data)
deprecated
deprecated
No description
at line 292
offsetGet($key)
deprecated
deprecated
No description
at line 307
offsetExists($key)
deprecated
deprecated
No description
at line 318
offsetUnset($key)
deprecated
deprecated
No description
at line 328
release()
deprecated
deprecated
No description
at line 343
static bool
checkCallbacks($callbacks)
Checks CALLBACKS dependencies.