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 49
__construct(IStorage $storage, $namespace = NULL)
No description
at line 60
IStorage
getStorage()
Returns cache storage.
at line 70
string
getNamespace()
Returns cache namespace.
at line 81
Cache
derive($namespace)
Returns new nested cache object.
at line 94
mixed|null
load($key, $fallback = NULL)
Reads the specified item from the cache or generate it.
at line 123
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 190
void
remove($key)
Removes item from the cache.
at line 204
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 216
mixed
call($function)
Caches results of function/method calls.
at line 234
Closure
wrap($function, array $dependencies = NULL)
Caches results of function/method calls.
at line 256
OutputHelper|null
start($key)
Starts the output cache.
at line 272
protected string
generateKey($key)
Generates internal cache key.
at line 284
offsetSet($key, $data)
deprecated
deprecated
No description
at line 293
offsetGet($key)
deprecated
deprecated
No description
at line 307
offsetExists($key)
deprecated
deprecated
No description
at line 317
offsetUnset($key)
deprecated
deprecated
No description
at line 326
release()
deprecated
deprecated
No description
at line 340
static bool
checkCallbacks($callbacks)
Checks CALLBACKS dependencies.