PhpArrayAdapter
class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInterface, ResettableInterface
Caches items at warm up time using a PHP array that is stored in shared memory by OPCache since PHP 7.0.
Warmed up items are read-only and run-time discovered items are cached using a fallback adapter.
Traits
Methods
Fetches a value from the pool or computes it if not found.
Wraps the callback passed to ->get() in a callable.
This adapter takes advantage of how PHP stores arrays in its latest versions.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
No description
Details
mixed
get(string $key, callable $callback, float $beta = null, array $metadata = null)
Fetches a value from the pool or computes it if not found.
On cache misses, a callback is called that should return the missing value. This callback is given a PSR-6 CacheItemInterface instance corresponding to the requested key, that could be used e.g. for expiration control. It could also be an ItemInterface instance when its additional features are needed.
callable
setCallbackWrapper(callable|null $callbackWrapper)
Wraps the callback passed to ->get() in a callable.