Methods
Add an item.
addItem(string $key, mixed $value) : bool
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Add multiple items.
addItems(array $keyValuePairs) : array
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
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.
Parameters
$token
mixed
$key
string
$value
mixed
Exceptions
Returns
bool
Remove items of given namespace
clearByNamespace(string $namespace) : bool
Parameters
$namespace
string
Returns
bool
Remove items matching given prefix
clearByPrefix(string $prefix) : bool
Parameters
$prefix
string
Returns
bool
Remove expired items
clearExpired() : bool
Decrement an item.
decrementItem(string $key, int $value) : int | bool
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Decrement multiple items.
decrementItems(array $keyValuePairs) : array
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() : int | float
Get an item.
getItem(string $key, bool $success, mixed $casToken) : mixed
Parameters
$key
string
$success
bool
$casToken
mixed
Exceptions
Returns
mixed
Data on success, null on failure
Get multiple items.
getItems(array $keys) : array
Parameters
$keys
array
Exceptions
Returns
array
Associative array of keys and values
Get total space in bytes
getTotalSpace() : int | float
Test if an item exists.
hasItem(string $key) : bool
Parameters
$key
string
Exceptions
Returns
bool
Test multiple items.
hasItems(array $keys) : array
Parameters
$keys
array
Exceptions
Returns
array
Array of found keys
Increment an item.
incrementItem(string $key, int $value) : int | bool
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Increment multiple items.
incrementItems(array $keyValuePairs) : array
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Optimize the storage
optimize() : bool
Remove an item.
removeItem(string $key) : bool
Parameters
$key
string
Exceptions
Returns
bool
Remove multiple items.
removeItems(array $keys) : array
Parameters
$keys
array
Exceptions
Returns
array
Array of not removed keys
Replace an existing item.
replaceItem(string $key, mixed $value) : bool
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Replace multiple existing items.
replaceItems(array $keyValuePairs) : array
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Store an item.
setItem(string $key, mixed $value) : bool
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Store multiple items.
setItems(array $keyValuePairs) : array
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Reset lifetime of an item
touchItem(string $key) : bool
Parameters
$key
string
Exceptions
Returns
bool
Reset lifetime of multiple items.
touchItems(array $keys) : array
Parameters
$keys
array
Exceptions
Returns
array
Array of not updated keys
Properties
Marker to change capabilities
$capabilityMarker : null | object