NamespacedVersionedKeys
Shared namespace/version key-building for adapters that scope clear()/destroy() to a namespace via generational versioning (Apc, Memcached, Redis) rather than wiping the whole shared backend
Using classes must have a protected string $namespace property and implement fetchVersion() to read
the raw version value back from their own backend.
Tags
Table of Contents
Methods
- fetchVersion() : mixed
- Fetch the raw version value from the backend, or false if it isn't set
- key() : string
- Build the versioned, namespaced storage key for an item id
- resolveVersion() : int
- Resolve the current version for this namespace, defaulting to 1
- versionKey() : string
- Get the storage key for this namespace's version counter
Methods
fetchVersion()
Fetch the raw version value from the backend, or false if it isn't set
protected
abstract fetchVersion(string $key) : mixed
Parameters
- $key : string
key()
Build the versioned, namespaced storage key for an item id
protected
key(string $id) : string
Parameters
- $id : string
Return values
stringresolveVersion()
Resolve the current version for this namespace, defaulting to 1
protected
resolveVersion() : int
Return values
intversionKey()
Get the storage key for this namespace's version counter
protected
versionKey() : string