class PhpArrayAdapter implements AdapterInterface, 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

prune()

{@inheritdoc}

reset()

{@inheritdoc}

warmUp(array $values)

Store an array of cached values.

clear()

{@inheritdoc}

__construct(string $file, AdapterInterface $fallbackPool)

No description

static CacheItemPoolInterface
create(string $file, CacheItemPoolInterface $fallbackPool)

This adapter takes advantage of how PHP stores arrays in its latest versions.

getItem($key)

{@inheritdoc}

getItems(array $keys = [])

{@inheritdoc}

hasItem($key)

{@inheritdoc}

deleteItem($key)

{@inheritdoc}

deleteItems(array $keys)

{@inheritdoc}

save(CacheItemInterface $item)

{@inheritdoc}

saveDeferred(CacheItemInterface $item)

{@inheritdoc}

commit()

{@inheritdoc}

static 
throwOnRequiredClass($class)

No description

Details

in ProxyTrait at line 29
prune()

{@inheritdoc}

in ProxyTrait at line 37
reset()

{@inheritdoc}

in PhpArrayTrait at line 36
warmUp(array $values)

Store an array of cached values.

Parameters

array $values The cached values

in PhpArrayTrait at line 117
clear()

{@inheritdoc}

at line 39
__construct(string $file, AdapterInterface $fallbackPool)

Parameters

string $file The PHP file were values are cached
AdapterInterface $fallbackPool A pool to fallback on when an item is not hit

at line 66
static CacheItemPoolInterface create(string $file, CacheItemPoolInterface $fallbackPool)

This adapter takes advantage of how PHP stores arrays in its latest versions.

Parameters

string $file The PHP file were values are cached
CacheItemPoolInterface $fallbackPool Fallback when opcache is disabled

Return Value

CacheItemPoolInterface

at line 83
CacheItem getItem($key)

{@inheritdoc}

Parameters

$key

Return Value

CacheItem

at line 117
Traversable|CacheItem[] getItems(array $keys = [])

{@inheritdoc}

Parameters

array $keys

Return Value

Traversable|CacheItem[]

at line 134
hasItem($key)

{@inheritdoc}

Parameters

$key

at line 149
deleteItem($key)

{@inheritdoc}

Parameters

$key

at line 164
deleteItems(array $keys)

{@inheritdoc}

Parameters

array $keys

at line 194
save(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

at line 206
saveDeferred(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

at line 218
commit()

{@inheritdoc}

at line 260
static throwOnRequiredClass($class)

Parameters

$class

Exceptions

ReflectionException When $class is not found and is required