OperationsMode
Corex\Config\Operations\OperationsMode · class · Config layer
Pure model for the CoreX Operations Mode (spec 065). The operations mode is a real, operator-declared state (persisted by {@see OperationsModeStore}) — distinct from wp_get_environment_type(), which is the default when no mode has been declared. This model owns the truthful metadata for each mode: label, tone, description, the warnings the mode implies, whether changing to it needs confirmation (production, maintenance and coming soon do), and whether it changes public behaviour (maintenance and coming soon do). WordPress-free, so it is unit-testable. It NEVER changes site behaviour itself — the boundary does, safely and reversibly. Coming soon (spec 101) is the fifth mode. Spec 063 named it and spec 065 shipped without it; what each of the two closed modes does to a visitor is {@see MaintenanceGuard} and {@see ComingSoonGuard}, and they are deliberately not the same thing.
Public API
Section titled “Public API”all(): array
Section titled “all(): array”The selectable modes, in display order.
isValid(string $mode): bool
Section titled “isValid(string $mode): bool”normalize(string $mode): string
Section titled “normalize(string $mode): string”Normalise an arbitrary value to a real mode; unknown values fall back to production (the safe default that changes no behaviour), never to an invented mode.
requiresConfirmation(string $mode): bool
Section titled “requiresConfirmation(string $mode): bool”Changing to production, maintenance or coming soon requires an explicit confirmation step.
affectsPublic(string $mode): bool
Section titled “affectsPublic(string $mode): bool”Maintenance and coming soon change public behaviour: a 503 notice in one, the coming-soon page and a redirect to it in the other.
describe(string $mode): array
Section titled “describe(string $mode): array”warnings(string $mode): array
Section titled “warnings(string $mode): array”The mode-specific warnings an operator should see. Real, advisory guidance — not a fabricated status.
cautions(string $mode): array
Section titled “cautions(string $mode): array”The warnings that say something {@see describe()}‘s detail does not: what the mode leaves exposed, or what the operator still has to do. Shown under the current mode, where a warning that restates the detail is the same sentence twice.