Index

Readiness

MMO\admin\helpers · 1 symbol · generated 5 Oct 2026

class

Readiness

Readiness.php:26

Whether a project is set up to deploy, read from its files alone: what the dashboard shows before offering anything, and what decides whether it offers deploying at all.

class MMO\admin\helpers\Readiness
Namespace
MMO\admin\helpers
It never connects to anything -- that is `doctor`'s job, and a screen that takes a minute to draw because a server is down is a screen nobody opens. What it can tell without the network is most of what goes wrong on a first setup: no deploy.json, one that does not load, a server whose alias no file declares, a key auth with no key, a target list that is still the template's. Each finding is a `check`: blocking ones mean setup is not done, and the dashboard offers setup alone; the others are worth fixing, and are shown beside the actions.
$readiness = new Readiness('/var/www/acme/deploy.json'); $readiness->isReady(); // false while a server cannot be reached with what the files say $readiness->getChecks(); // [['step' => 'servers', 'label' => 'web1', 'ok' => false, ...], ...]

Properties10

checks

protected array $checks = []
Type
array

credentialsFilename

protected ?string $credentialsFilename
Type
null | string

data

protected array $data = []
Type
array

filename

protected string $filename
Type
string

folder

protected string $folder
Type
string

sshConfigFilename

protected ?string $sshConfigFilename
Type
null | string

store

protected ?MMO\admin\helpers\Store $store = null
Type
null | Store

template

protected array $template = []
Type
array

templateFolder

protected ?string $templateFolder
Type
null | string

Methods19

getBlocking()

Readiness.php:75
function getBlocking(): array
returnsarraythe findings that mean setup is not done.

getChecks()

Readiness.php:69
function getChecks(): array
returnsarrayevery finding: {step, label, ok, detail, blocking}. ok is true (fine), false (to fix) or null (not applicable); step is the step of setup that fixes it.

getWarnings()

Readiness.php:80
function getWarnings(): array
returnsarraythe findings worth fixing that do not stop a deployment.

isIgnored($file)

Readiness.php:250
protected function isIgnored(string $file): ?bool
$filestring
returnsnull | boolwhether git ignores $file, relative to the project. null: no repository to ask.

isReady()

Readiness.php:72
function isReady(): bool
returnsboolwhether nothing stands between this project and a deployment, as far as its files tell.

reachProblem($server, $user)

Readiness.php:198
protected function reachProblem(MMO\admin\entities\Server $server, ?MMO\admin\helpers\SshConfig $user): ?string
$serverServer
$usernull | SshConfig
returnsnull | stringwhy a server cannot be reached with what the files say, null when it can.

readJson($filename)

Readiness.php:257
protected function readJson(string $filename): array
$filenamestring
returnsarraya JSON file with comments, its // keys dropped.

__construct($filename, $credentialsFilename, $sshConfigFilename, $templateFolder, $git)

Readiness.php:48
function __construct( string $filename, ?string $credentialsFilename = null, ?string $sshConfigFilename = null, ?string $templateFolder = null, ?MMO\git\helpers\Repository $git = null )
$filenamestringthe project's deploy.json, which may not exist yet.
$credentialsFilename = nullnull | stringnull: deploy.credentials.json beside it.
$sshConfigFilename = nullnull | stringnull: deploy.ssh.config beside it.
$templateFolder = nullnull | stringmmo.admin's templates (null: this library's).
$git = nullnull | Repositorythe project's repository (null: the folder of deploy.json, if it is one).