API / Minn\Ops / Diagnostics

Diagnostics final readonly class

Minn\Ops\Diagnostics · public/minn/src/Minn/Ops/Diagnostics.php · 408 lines

The System view's facts about this install: the engine, PHP, the database, and the server, with the health checks a site owner acts on. Every number is read live; nothing is cached or fetched from outside.

Constants and properties

privateAUTOLOAD_VALUES = array ( 0 => 'yes', 1 => 'on', 2 => 'auto', 3 => 'auto-on', )
privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Ops\InstalledSoftware $software

Promoted from the constructor.

privatereadonly Minn\Ops\Logs $logs

Promoted from the constructor.

privatereadonly string $engineVersion

Promoted from the constructor.

privatereadonly string $webroot

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Ops\InstalledSoftware $software, Minn\Ops\Logs $logs, string $engineVersion, string $webroot)#
methodpayload(Minn\Http\Request $request): array#

The System view: checks, config, logs, and the four info groups.

methodconfig(): array#

The wp-config debug constants as they stand; the engine never rewrites the file.

methodcron(): array#

The scheduled events: the cron option's hooks and the engine's own scheduled posts, soonest first.

methodautoload(): array#

The autoloaded options: the summary and the largest rows.

Internals 16

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

privatechecks(Minn\Http\Request $request, array $autoload, array $cron, Minn\Mail\MailSettings $mail): array#

The pass / warn / fail rows the System view leads with.

$autoloadarray<string, mixed>
$cronarray<string, mixed>
@return list<array<string, string>>
privateengineGroup(array $cron, Minn\Mail\MailSettings $mail): array#
$cronarray<string, mixed>@return array<string, string>
privatephpGroup(): array#
@return array<string, string>
privateserverGroup(Minn\Http\Request $request): array#
@return array<string, string>
privateopcacheOn(): bool#
privatecronOptionEvents(): array#

The cron option's events as rows, a recurring event's interval read as its recurrence and a single event marked one-off.

@return list<array<string, mixed>>
privatehumanInterval(int $seconds): string#

A recurrence interval as its two largest whole units.

privateautoloadSummary(): array#
privatecronSummary(): array#
@return array{events: int, overdue: int, next: ?int}
privatefuturePosts(): array#
@return list<array<string, mixed>>
privatedatabaseGroup(): array#
@return array{0: array<string, string>, 1: list<array>}
privatecheck(string $key, string $label, string $status, string $detail): array#
privaterows(array $pairs): array#
@return list<array{key: string, value: string}>
privatebytes(string $value): int#
privateoffsetLabel(float $offset): string#
privaterelative(int $at): string#