Methods
Constructor
__construct(null | array | \Traversable | \Zend\Cache\Storage\Adapter\AdapterOptions $options)
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::__construct() |
Parameters
Exceptions
Destructor
__destruct() : void
Inherited
detach all registered plugins to free
event handles of event manager
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::__destruct() |
Add an item.
addItem(string $key, mixed $value) : bool
triggers |
addItem.pre(PreEvent) |
triggers |
addItem.post(PostEvent) |
triggers |
addItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Add multiple items.
addItems(array $keyValuePairs) : bool
triggers |
addItems.pre(PreEvent) |
triggers |
addItems.post(PostEvent) |
triggers |
addItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
bool
Register a plugin
addPlugin(\Zend\Cache\Storage\Plugin\PluginInterface $plugin, int $priority) : \Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::addPlugin() |
Parameters
$priority
int
Exceptions
Returns
Set an item only if token matches
checkAndSetItem(mixed $token, string $key, mixed $value) : bool
It uses the token received from getItem() to check if the item has
changed before overwriting it.
see |
\Zend\Cache\Storage\Adapter\getItem() |
see |
\Zend\Cache\Storage\Adapter\setItem() |
Parameters
$token
mixed
$key
string
$value
mixed
Exceptions
Returns
bool
Remove items by given namespace
clearByNamespace(string $namespace) : bool
Parameters
$namespace
string
Exceptions
Returns
bool
Remove items matching given prefix
clearByPrefix(string $prefix) : bool
Parameters
$prefix
string
Exceptions
Returns
bool
Remove expired items
clearExpired() : bool
triggers |
clearExpired.exception(ExceptionEvent) |
Returns
bool
Decrement an item.
decrementItem(string $key, int $value) : int | bool
Inherited
triggers |
decrementItem.pre(PreEvent) |
triggers |
decrementItem.post(PostEvent) |
triggers |
decrementItem.exception(ExceptionEvent) |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::decrementItem() |
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Decrement multiple items.
decrementItems(array $keyValuePairs) : array
Inherited
triggers |
incrementItems.pre(PreEvent) |
triggers |
incrementItems.post(PostEvent) |
triggers |
incrementItems.exception(ExceptionEvent) |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::decrementItems() |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Flush the whole storage
flush() : bool
Get available space in bytes
getAvailableSpace() : float
Get caching enabled.
getCaching() : bool
Inherited
Alias of getWritable and getReadable.
see |
\Zend\Cache\Storage\Adapter\getWritable() |
see |
\Zend\Cache\Storage\Adapter\getReadable() |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::getCaching() |
Returns
bool
Get capabilities of this adapter
getCapabilities() : \Zend\Cache\Storage\Capabilities
Inherited
triggers |
getCapabilities.pre(PreEvent) |
triggers |
getCapabilities.post(PostEvent) |
triggers |
getCapabilities.exception(ExceptionEvent) |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::getCapabilities() |
Returns
Get the event manager
getEventManager() : \Zend\EventManager\EventManagerInterface
Inherited
Lazy-loads an EventManager instance if none registered.
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::getEventManager() |
Returns
Get an item.
getItem(string $key, bool $success, mixed $casToken) : mixed
triggers |
getItem.pre(PreEvent) |
triggers |
getItem.post(PostEvent) |
triggers |
getItem.exception(ExceptionEvent) |
Parameters
$key
string
$success
bool
$casToken
mixed
Exceptions
Returns
mixed
Data on success, null on failure
Get multiple items.
getItems(array $keys) : array
triggers |
getItems.pre(PreEvent) |
triggers |
getItems.post(PostEvent) |
triggers |
getItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Associative array of keys and values
Return registry of plugins
getPluginRegistry() : \SplObjectStorage
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::getPluginRegistry() |
Returns
Get total space in bytes
getTotalSpace() : int | float
Exceptions
Returns
int
float
Test if an item exists.
hasItem(string $key) : bool
triggers |
hasItem.pre(PreEvent) |
triggers |
hasItem.post(PostEvent) |
triggers |
hasItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Test multiple items.
hasItems(array $keys) : array
triggers |
hasItems.pre(PreEvent) |
triggers |
hasItems.post(PostEvent) |
triggers |
hasItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of found keys
Check if a plugin is registered
hasPlugin(\Zend\Cache\Storage\Plugin\PluginInterface $plugin) : bool
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::hasPlugin() |
Parameters
Returns
bool
Increment an item.
incrementItem(string $key, int $value) : int | bool
Inherited
triggers |
incrementItem.pre(PreEvent) |
triggers |
incrementItem.post(PostEvent) |
triggers |
incrementItem.exception(ExceptionEvent) |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::incrementItem() |
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Increment multiple items.
incrementItems(array $keyValuePairs) : array
Inherited
triggers |
incrementItems.pre(PreEvent) |
triggers |
incrementItems.post(PostEvent) |
triggers |
incrementItems.exception(ExceptionEvent) |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::incrementItems() |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Remove an item.
removeItem(string $key) : bool
triggers |
removeItem.pre(PreEvent) |
triggers |
removeItem.post(PostEvent) |
triggers |
removeItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Remove multiple items.
removeItems(array $keys) : array
triggers |
removeItems.pre(PreEvent) |
triggers |
removeItems.post(PostEvent) |
triggers |
removeItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of not removed keys
Unregister an already registered plugin
removePlugin(\Zend\Cache\Storage\Plugin\PluginInterface $plugin) : \Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::removePlugin() |
Parameters
Exceptions
Returns
Replace an existing item.
replaceItem(string $key, mixed $value) : bool
triggers |
replaceItem.pre(PreEvent) |
triggers |
replaceItem.post(PostEvent) |
triggers |
replaceItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Replace multiple existing items.
replaceItems(array $keyValuePairs) : bool
triggers |
replaceItems.pre(PreEvent) |
triggers |
replaceItems.post(PostEvent) |
triggers |
replaceItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
bool
Enable/Disable caching.
setCaching(bool $flag) : \Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited
Alias of setWritable and setReadable.
see |
\Zend\Cache\Storage\Adapter\setWritable() |
see |
\Zend\Cache\Storage\Adapter\setReadable() |
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::setCaching() |
Parameters
$flag
bool
Returns
Store an item.
setItem(string $key, mixed $value) : bool
triggers |
setItem.pre(PreEvent) |
triggers |
setItem.post(PostEvent) |
triggers |
setItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Store multiple items.
setItems(array $keyValuePairs) : array
triggers |
setItems.pre(PreEvent) |
triggers |
setItems.post(PostEvent) |
triggers |
setItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Reset lifetime of an item
touchItem(string $key) : bool
triggers |
touchItem.pre(PreEvent) |
triggers |
touchItem.post(PostEvent) |
triggers |
touchItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Reset lifetime of multiple items.
touchItems(array $keys) : array
triggers |
touchItems.pre(PreEvent) |
triggers |
touchItems.post(PostEvent) |
triggers |
touchItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of not updated keys
Read a complete file
getFileContent(string $file, bool $nonBlocking, bool $wouldblock) : string
Parameters
$file
string
File complete path
$nonBlocking
bool
Don't block script if file is locked
$wouldblock
bool
The optional argument is set to TRUE if the lock would block
Exceptions
Returns
string
Get file spec of the given key and namespace
getFileSpec(string $normalizedKey) : string
Parameters
$normalizedKey
string
Returns
string
Internal method to add an item.
internalAddItem(string $normalizedKey, mixed $value) : bool
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalAddItem() |
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to add multiple items.
internalAddItems(array $normalizedKeyValuePairs) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalAddItems() |
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to set an item only if token matches
internalCheckAndSetItem(mixed $token, string $normalizedKey, mixed $value) : bool
see |
\Zend\Cache\Storage\Adapter\getItem() |
see |
\Zend\Cache\Storage\Adapter\setItem() |
Parameters
$token
mixed
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to decrement an item.
internalDecrementItem(string $normalizedKey, int $value) : int | bool
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalDecrementItem() |
Parameters
$normalizedKey
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Internal method to decrement multiple items.
internalDecrementItems(array $normalizedKeyValuePairs) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalDecrementItems() |
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Internal method to get an item.
internalGetItem(string $normalizedKey, bool $success, mixed $casToken) : null | mixed
Parameters
$normalizedKey
string
$success
bool
$casToken
mixed
Exceptions
Returns
null
mixed
Data on success, null on failure
Internal method to get multiple items.
internalGetItems(array $normalizedKeys) : array
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Associative array of keys and values
Internal method to test if an item exists.
internalHasItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to test multiple items.
internalHasItems(array $normalizedKeys) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalHasItems() |
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of found keys
Internal method to increment an item.
internalIncrementItem(string $normalizedKey, int $value) : int | bool
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalIncrementItem() |
Parameters
$normalizedKey
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Internal method to increment multiple items.
internalIncrementItems(array $normalizedKeyValuePairs) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalIncrementItems() |
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Internal method to remove an item.
internalRemoveItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to remove multiple items.
internalRemoveItems(array $normalizedKeys) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalRemoveItems() |
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of not removed keys
Internal method to replace an existing item.
internalReplaceItem(string $normalizedKey, mixed $value) : bool
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalReplaceItem() |
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to replace multiple existing items.
internalReplaceItems(array $normalizedKeyValuePairs) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalReplaceItems() |
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to store an item.
internalSetItem(string $normalizedKey, mixed $value) : bool
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to store multiple items.
internalSetItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to reset lifetime of an item
internalTouchItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to reset lifetime of multiple items.
internalTouchItems(array $normalizedKeys) : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::internalTouchItems() |
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of not updated keys
Validates and normalizes a key
normalizeKey(string $key) : void
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::normalizeKey() |
Parameters
$key
string
Exceptions
Validates and normalizes an array of key-value pairs
normalizeKeyValuePairs(array $keyValuePairs) : void
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::normalizeKeyValuePairs() |
Parameters
$keyValuePairs
array
Exceptions
Validates and normalizes multiple keys
normalizeKeys(array $keys) : void
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::normalizeKeys() |
Parameters
$keys
array
Exceptions
Prepares a directory structure for the given file(spec)
using the configured directory level.
prepareDirectoryStructure(string $file) : void
Parameters
$file
string
Exceptions
Write content to a file
putFileContent(string $file, string $data, bool $nonBlocking, bool $wouldblock) : void
Parameters
$file
string
File complete path
$data
string
Data to write
$nonBlocking
bool
Don't block script if file is locked
$wouldblock
bool
The optional argument is set to TRUE if the lock would block
Exceptions
Read info file
readInfoFile(string $file, bool $nonBlocking, bool $wouldblock) : array | bool
Parameters
$file
string
$nonBlocking
bool
Don't block script if file is locked
$wouldblock
bool
The optional argument is set to TRUE if the lock would block
Exceptions
Returns
array
bool
The info array or false if file wasn't found
Removes directories recursive by namespace
rmDir(string $dir, string $prefix) : bool
Parameters
$dir
string
Directory to delete
$prefix
string
Namespace + Separator
Returns
bool
Trigger an exception event
triggerException(string $eventName, \ArrayObject $args, mixed $result, \Exception $exception) : mixed
Inherited
If the ExceptionEvent has the flag "throwException" enabled throw the
exception after trigger else return the result.
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::triggerException() |
Parameters
$eventName
string
$result
mixed
Exceptions
Returns
mixed
Triggers the PostEvent and return the result value.
triggerPost(string $eventName, \ArrayObject $args, mixed $result) : mixed
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::triggerPost() |
Parameters
$eventName
string
$result
mixed
Returns
mixed
Trigger a pre event and return the event response collection
triggerPre(string $eventName, \ArrayObject $args) : \Zend\EventManager\ResponseCollection
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::triggerPre() |
Parameters
$eventName
string
Returns
Unlink a file
unlink(string $file) : void
Parameters
$file
string
Exceptions
Properties
Capabilities of this adapter
$capabilities : null | \Zend\Cache\Storage\Capabilities
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::$$capabilities |
Marker to change capabilities
$capabilityMarker : null | object
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::$$capabilityMarker |
Event handles of this adapter
$eventHandles : array
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::$$eventHandles |
The last used filespec
$lastFileSpec : string
An identity for the last filespec
(cache directory + namespace prefix + key + directory level)
$lastFileSpecId : string
options
$options : mixed
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::$$options |
The plugin registry
$pluginRegistry : \SplObjectStorage
Inherited
inherited_from |
\Zend\Cache\Storage\Adapter\AbstractAdapter::$$pluginRegistry |
Buffered total space in bytes
$totalSpace : null | int | float