API / Minn\Runtime / OptionsGroup

OptionsGroup final class

Minn\Runtime\OptionsGroup · public/minn/src/Minn/Runtime/OptionsGroup.php · 57 lines

wp_cache's options group, where option reads are kept as the reference keeps them: the autoloaded list under alloptions, the names a read found unset under notoptions, and one key per option not autoloaded. The engine's own object cache holds it, or an object-cache.php drop-in once the facade hands over its functions.

A drop-in's cache outlives the request, and the engine writes some options behind the store (its own state, the CLI), so a key left by an earlier request is never trusted: each is read from the database the first time a request asks for it, then kept in step for the rest of it.

Uses 1
Used by 1

Constants and properties

constGROUP = 'options'
privatestatic ?array $external
privatearray $fresh

Public

staticuseExternal(Closure $get, Closure $set, Closure $delete): void#

Hands the group to an object-cache.php drop-in's functions.

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

A key's value, found only when this request may trust it.

methodset(string $key, mixed $value): void#

Stores a key; a drop-in is written only when it holds something else.

methoddelete(string $key): void#

Removes a key.