Interface CacheEngineInterface
Interface for cache engines that defines methods
outside of the PSR16 interface that are used by Cache
.
Internally Cache uses this interface when calling engine methods.
Method Summary
-
add() public
Write data for key into a cache engine if it doesn't exist already.
-
clearGroup() public
Clear all values belonging to the named group.
-
decrement() public
Decrement a number under the key and return decremented value
-
increment() public
Increment a number under the key and return incremented value
Method Detail
add() ¶ public
add(string $key, mixed $value): bool
Write data for key into a cache engine if it doesn't exist already.
Parameters
-
string
$key Identifier for the data.
-
mixed
$value Data to be cached - anything except a resource.
Returns
bool
clearGroup() ¶ public
clearGroup(string $group): bool
Clear all values belonging to the named group.
Each implementation needs to decide whether actually delete the keys or just augment a group generation value to achieve the same result.
Parameters
-
string
$group name of the group to be cleared
Returns
bool
decrement() ¶ public
decrement(string $key, int $offset = 1): int|false
Decrement a number under the key and return decremented value
Parameters
-
string
$key Identifier for the data
-
int
$offset optional How much to subtract
Returns
int|false
increment() ¶ public
increment(string $key, int $offset = 1): int|false
Increment a number under the key and return incremented value
Parameters
-
string
$key Identifier for the data
-
int
$offset optional How much to add
Returns
int|false