API / Minn\Runtime / Deferrals

Deferrals final class

Minn\Runtime\Deferrals · public/minn/src/Minn/Runtime/Deferrals.php · 66 lines

The switches an importer flips for the length of a request (probe plugin-helpers): term and comment counts deferred until the switch goes off again, when what was put off is counted at once, and cache additions suspended so a bulk read does not fill the cache. Each answers what it is now; a value that is not a boolean asks without changing it. Kept in the request's state, so a worker's next request starts with them off.

Uses 1

Public

staticterms(mixed $defer): bool#

wp_defer_term_counting: on, off, or asked; off counts what was put off.

staticcomments(mixed $defer): bool#

wp_defer_comment_counting: on, off, or asked; off counts what was put off.

staticcacheAddition(mixed $suspend): bool#

wp_suspend_cache_addition: on, off, or asked.

staticputOffTerms(array $terms, string $taxonomy): bool#

Puts terms' recount off while counting is deferred; false when it is not (count now). @param list<int> $terms

$termslist<int>
staticputOffComments(int $post): bool#

Puts a post's comment recount off while counting is deferred; false when it is not (count now).

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateflip(string $key, mixed $value): bool#