API / Minn\Runtime / ObjectCache

ObjectCache final class

Minn\Runtime\ObjectCache · public/minn/src/Minn/Runtime/ObjectCache.php · 63 lines

The per-request object cache behind wp_cache_*: groups of keys, nothing persistent.

Used by 1

Constants and properties

privatearray $groups

Public

methodget(string $key, string $group, ?bool $found = NULL): mixed#

A cached value, or false.

methodset(string $key, mixed $value, string $group): bool#

Stores a value.

methodadd(string $key, mixed $value, string $group): bool#

Stores a value only when the key is empty.

methoddelete(string $key, string $group): bool#

Removes a key.

methodflush(): bool#

Empties the cache.

methodsizes(): array#

Each group's size, its entries serialized, in bytes, in the order the groups were first written: what WP_Object_Cache::stats prints.

@return array<string, int>
methodflushGroup(string $group): bool#

Empties one group.