MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

Dashboard

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

class

Dashboard

Dashboard.php:26

php scripts/admin.php with no command: one screen showing the project, its targets, its servers and what was deployed where -- beside the list of what can be done from here, one key each.

class MMO\admin\helpers\Dashboard
Namespace
MMO\admin\helpers
It offers only what can be done. Until the files say setup is done ([`Readiness`](https://mmoframework.fr/en/documentation/mmo.admin/php/helpers/Readiness.md#readiness)), the actions are the steps of setup, each one short and on its own, with what is missing next to them: deploying is not offered to a project that cannot deploy. Once it can, setup is one key away (`g`) and the actions are grouped by what they touch: looking changes nothing, deploying changes the targets. Every action is the command of the same name ([`ProductionController`](https://mmoframework.fr/en/documentation/mmo.admin/php/controllers/ProductionController.md#productioncontroller)), so the dashboard adds no behaviour: it explains an action before running it, and prints the command line doing the same, which is what a script or a CI job would type. Drawing it never connects to anything. What it shows of the targets is this machine's record of them ([`Store::HISTORY`](https://mmoframework.fr/en/documentation/mmo.admin/php/helpers/Store.md#store-history)), refreshed by `sync` and by every deployment made from here -- `status` asks the targets.

Index

ACTIONSkey => [command, group, summary, what it does].
GROUPSgroup => its title.
SETUPthe keys of the setup steps: numbers, as they are done in that order.
controller
notice
route
setupScreen
actionKeys($readiness)
ago($date)
available($readiness)
check($check)
clear()
columns($left, $right)Print two columns side by side when the terminal is wide enough, one under the other otherwise.
debugName()
deploymentsPanel()
drawActions($readiness)
drawSetup($readiness)
fit($line, $width)
gitLine()
guide($readiness)What to do next, from where the project is: printed by ?.
header($readiness)
history($count)
item($key, $name, $summary, $mark)
lastDeployments()
manifest()
outcomeColor($entry)
pause()At a terminal, wait for a key before drawing the screen again over what the action printed.
prose($text, $indent, $lead)
readKey($keys)One key, taken the moment it is pressed at a terminal; one line anywhere else.
rightWidth()
run()Draw, read a key, run what it stands for, until q.
runAction($key)
runSetup($step)
serversPanel()
setupKeys($readiness)
targetsPanel()
title($title, $note)
width()
__construct($controller, $route)

Constants3

ACTIONS

key => [command, group, summary, what it does]. The command is the route of ProductionController run for it, and the name to type on the command line.

const ACTIONS = […18 items]

GROUPS

group => its title.

const GROUPS = […5 items]

SETUP

the keys of the setup steps: numbers, as they are done in that order.

const SETUP = […5 items]

Properties4

notice

protected string $notice = ''
Type
string

route

protected MMO\core\server\Route $route
Type
Route

setupScreen

protected bool $setupScreen = false
Type
bool

Methods32

available($readiness)

Dashboard.php:325
protected function available(MMO\admin\helpers\Readiness $readiness): array
$readinessReadiness
returnsarraykey => action, of those this project can do.

check($check)

Dashboard.php:470
protected function check(array $check): array
$checkarray
returnsarraya finding of Readiness: its mark, its label, and what it says, wrapped under itself.

columns($left, $right)

Dashboard.php:409

Print two columns side by side when the terminal is wide enough, one under the other otherwise. The actions are cut to their column; what is beside them is wrapped, as a detail cut short is a detail lost.

protected function columns(array $left, array $right): void
$leftarray
$rightarray
returnsvoid

fit($line, $width)

Dashboard.php:450
protected function fit(string $line, int $width): string
$linestring
$widthint
returnsstring$line cut to $width visible characters, its escape sequences kept.

gitLine()

Dashboard.php:519
protected function gitLine(): string
returnsstringthe branch, the commit and whether the working tree is clean.

guide($readiness)

Dashboard.php:292

What to do next, from where the project is: printed by ?.

protected function guide(MMO\admin\helpers\Readiness $readiness): void
$readinessReadiness
returnsvoid

history($count)

Dashboard.php:483
protected function history(int $count): array
$countint
returnsarraythe newest deployments this machine has recorded, newest first.

item($key, $name, $summary, $mark)

Dashboard.php:465
protected function item(string $key, string $name, string $summary, string $mark = ' '): string
$keystringwhat to press.
$namestring
$summarystring
$mark = ' 'stringshown before the key: the state of a setup step.
returnsstring

lastDeployments()

Dashboard.php:491
protected function lastDeployments(): array
returnsarraytarget => its newest recorded deployment that shipped a release.

pause()

Dashboard.php:382

At a terminal, wait for a key before drawing the screen again over what the action printed.

protected function pause(): void
returnsvoid

prose($text, $indent, $lead)

Dashboard.php:440
protected function prose(string $text, int $indent, string $lead = ''): array
$textstringa sentence, rather than a row of a table: wrapped rather than cut, as a detail cut short is a detail lost.
$indentintspaces before every line.
$lead = ''stringwhat the first line starts with, after the indent; the others start under its text.
returnsarray

readKey($keys)

Dashboard.php:353

One key, taken the moment it is pressed at a terminal; one line anywhere else.

protected function readKey(array $keys): ?string
$keysarraywhat it may be.
returnsnull | stringthe key, '' for ENTER, null for ESC or the end of the input.

rightWidth()

Dashboard.php:428
protected function rightWidth(): int
returnsintthe width of what is shown beside the actions: the whole width, when it is shown under them.

run()

Dashboard.php:99

Draw, read a key, run what it stands for, until q.

function run(): void
returnsvoid

targetsPanel()

Dashboard.php:219
protected function targetsPanel(): array
returnsarraythe targets, what they deploy, where, and the last deployment this machine knows of.