APCU
class APCU extends Store implements IncrementDecrementInterface
APCU store.
Properties
protected string|null | $prefix | Prefix. | from Store |
protected bool | $atomicGetOrElse | Whether to use atomic updates for getOrElse. |
Methods
Store data in the cache if it doesn't already exist.
Fetch data from the cache and replace it.
Fetch data from the cache or store it if it doesn't already exist.
Constructor.
Set whether to use atomic get/set for getOrElse.
Store data in the cache.
Increments a stored number.
Decrements a stored number.
Returns TRUE if the cache key exists and FALSE if not.
Fetch data from the cache.
Delete data from the cache.
Clears the cache.
Details
in Store at line 30
$this
setPrefix(string $prefix)
Sets the cache key prefix.
in Store at line 42
string|null
getPrefix()
Returns the cache key prefix.
in Store at line 53
protected string
getPrefixedKey(string $key)
Returns a prefixed key.
at line 75
bool
putIfNotExists(string $key, mixed $data, int $ttl = 0)
Store data in the cache if it doesn't already exist.
in Store at line 79
mixed
getAndPut(string $key, mixed $data, int $ttl = 0)
Fetch data from the cache and replace it.
in Store at line 94
mixed
getAndRemove(string $key)
Fetch data from the cache and remove it.
at line 115
mixed
getOrElse(string $key, callable $data, int $ttl = 0)
Fetch data from the cache or store it if it doesn't already exist.
at line 43
__construct()
Constructor.
at line 57
APCU
useAtomicGetOrElse(bool $toUse)
Set whether to use atomic get/set for getOrElse.
at line 67
bool
put(string $key, mixed $data, int $ttl = 0)
Store data in the cache.
at line 83
int|bool
increment(string $key, int $step = 1)
Increments a stored number.
at line 91
int|bool
decrement(string $key, int $step = 1)
Decrements a stored number.
at line 99
bool
has(string $key)
Returns TRUE if the cache key exists and FALSE if not.
at line 107
mixed
get(string $key)
Fetch data from the cache.
at line 128
bool
remove(string $key)
Delete data from the cache.
at line 136
bool
clear()
Clears the cache.