SetupWizard
MMO\admin\helpers · 1 symbol · generated 5 Oct 2026
SetupWizard
SetupWizard.php:46php scripts/admin.php setup: the questions whose answers are a project's deployment, asked in the order deploying needs them, each one explained -- then the files those answers make, shown before they are written.
- Namespace
MMO\admin\helpers
Index
Constants4
CANCELLED
the code of the eRuntime saying nobody answered: the run stops, and nothing is written.
HOST_KEYS
the kind of a host key => the file holding it on the server, whose fingerprint ssh-keygen -l prints there.
NAME
what a server, a project or a new target may be called: what a shell and a path take as they are.
STEPS
step => what it is about, in the order deploying needs them.
Properties24
appends
- Type
- array
bootstrap
- Type
- array
commands
- Type
- array
committable
- Type
- array
credentialsData
- Type
- array
credentialsFilename
credentialsText
- Type
- string
data
- Type
- array
dryRun
- Type
- bool
filename
- Type
- string
folder
- Type
- string
git
- Type
- null | Repository
hosts
- Type
- array
original
- Type
- string
renames
- Type
- array
secrets
- Type
- array
settings
- Type
- array
sshConfig
template
- Type
- array
templateFolder
templates
- Type
- array
vhost
webspaceRoots
- Type
- array
written
- Type
- bool
Methods96
address($row)
SetupWizard.php:1678aliasSettings($row)
SetupWizard.php:1671apply($changes)
SetupWizard.php:1461ask($question, $default, $validate)
SetupWizard.php:1538askAlias($server, $row, $was)
SetupWizard.php:580askAuth($row, $secrets)
SetupWizard.php:623askFingerprint($row)
SetupWizard.php:687askHost($row)
SetupWizard.php:610askList($question, $default, $validate)
SetupWizard.php:1542askManaged($row)
SetupWizard.php:679askPort($question, $default)
SetupWizard.php:1546askRoot($server, $row, $secrets, $local)
SetupWizard.php:785The folder every relative path of a target on this server starts from.
askVhost($template)
SetupWizard.php:1202Make the vhost template take its paths and its server name from each target: {public}, {folder} and {host} (Target::resolveTemplate) -- one template, right for every target whatever it declares -- and ask where the certificate is.
askWebspace($row, $folder, $before, $root)
SetupWizard.php:988What a target on a shared webspace needs that the others do not.
bootstrapFilename()
SetupWizard.php:1699| returns | string |
branch()
SetupWizard.php:1693changes()
SetupWizard.php:1288Every file the answers change, in the order it is safe to write them: .gitignore before the credentials file exists, so git never sees it unignored.
| returns | array | array{label: string, old: string, new: string, mode?: int, secret?: bool, template?: bool}> by filename. |
checkAgent()
SetupWizard.php:667Say whether an ssh agent is running and holds a key: agent needs both, and neither is in a file to check later.
| returns | void |
checkAttributes()
SetupWizard.php:392| returns | void |
checkCredentialsFile()
SetupWizard.php:441| returns | void |
checkHook()
SetupWizard.php:422| returns | void |
checkIgnored()
SetupWizard.php:342| returns | void |
checkKeys()
SetupWizard.php:248Deal, before anything else, with what would stop deploy.json from loading whatever the answers: a secret in it, and a key mmo.admin does not know.
| returns | void |
checkRef($ref)
SetupWizard.php:1091Warn about a branch this repository does not have: the first release of the target would fail on it.
closest($key, $known)
SetupWizard.php:1732conclude()
SetupWizard.php:1503What to do next, in order, with the commands to type.
| returns | void |
credentialsText()
SetupWizard.php:1393debugName()
SetupWizard.php:150| returns | string |
declarationText()
SetupWizard.php:1378| returns | string | deploy.json once the answers are in it: its own text, edited -- every key of every server and target written, and each one with a comment saying what it does (Declaration). |
defaultKey()
SetupWizard.php:1710describeServer($row)
SetupWizard.php:524directive($text, $pattern, $value)
SetupWizard.php:1237editServer($name)
SetupWizard.php:537editTarget($name)
SetupWizard.php:887entity($name, $row)
SetupWizard.php:1586expand($path)
SetupWizard.php:1717fingerprint($value)
SetupWizard.php:769| $value | string | a fingerprint as a tool prints it: MD5:aa:bb..., AABB..., with or without colons. |
| returns | null | string | lowercase hex pairs joined by colons -- what \MMO\core\server\SSH compares -- or null when it is not 32 (MD5) or 40 (SHA1) hex digits. A base64 fingerprint (SHA256:...) is not one the ssh2 extension can compute. |
freeName($prefix, $taken)
SetupWizard.php:1726hasDatabase()
SetupWizard.php:1647| returns | bool |
hostKeyFile($type)
SetupWizard.php:756ignoresNeeded()
SetupWizard.php:1352The .gitignore rules the files about to be written need and nothing gives them: a private file is never written where git would take it, whichever step made it.
| returns | array |
ignoreText($rule)
SetupWizard.php:370introduce($full)
SetupWizard.php:221isExample($section, $name)
SetupWizard.php:1638isHost($host)
SetupWizard.php:1761isIgnored($file)
SetupWizard.php:375isUrl($url)
SetupWizard.php:1757listServers()
SetupWizard.php:507| returns | void |
listTargets()
SetupWizard.php:869| returns | void |
load()
SetupWizard.php:199| returns | void |
manifest()
SetupWizard.php:1685| returns | array | the project's mmo.json, or nothing. |
mask($text)
SetupWizard.php:1457missingTemplates()
SetupWizard.php:327| returns | array | file relative to the project => template, for every template file the project lacks. |
moveSecret($path, $key, $what)
SetupWizard.php:289need($answer)
SetupWizard.php:1533objectify($data)
SetupWizard.php:1597panelPath($path, $root)
SetupWizard.php:1086pick($question, $options, $default)
SetupWizard.php:1550pickName($question, $names, $default)
SetupWizard.php:1560privateFiles()
SetupWizard.php:362| returns | array | array{0: string, 1: string}> file relative to the project => [the .gitignore rule ignoring it, why it must be]: what the project keeps that cannot be shared. Kept in the project, private, and out of git -- never in a folder of the user's. |
protectedTags()
SetupWizard.php:1643| returns | array | the tags that protect a target. |
readHostKey($host, $port)
SetupWizard.php:727Read the host key a server presents, the way the deployment's own connection will check it.
readWebspaceRoot($server, $row, $secrets)
SetupWizard.php:1057reference($path)
SetupWizard.php:1631relative($filename)
SetupWizard.php:1721relativePaths($paths)
SetupWizard.php:1766relativeTo($root, $path, $default)
SetupWizard.php:1078| $root | null | string | the server's root. |
| $path | null | string | a folder as deploy.json writes it (null: none yet). |
| $default | string | what to propose when there is none. |
| returns | string | $path as it is best written: relative to the root when it is under it, its last folder under the root when it is outside it -- another account's path, a placeholder -- and as it is otherwise. |
removeServer($name)
SetupWizard.php:828removeTarget($name)
SetupWizard.php:1109renameKey($values, $old, $new)
SetupWizard.php:1611review($changes)
SetupWizard.php:1439Show every change: what is added, removed, run -- secrets masked.
rules($text)
SetupWizard.php:413run($only)
SetupWizard.php:158Ask, explain, show, write.
saveServer($old, $new, $row, $secrets)
SetupWizard.php:808saveTarget($old, $new, $row)
SetupWizard.php:1099secret($question)
SetupWizard.php:1570setting($key)
SetupWizard.php:1655sshConfig()
SetupWizard.php:1661| returns | SshConfig |
step($step)
SetupWizard.php:186stepFiles()
SetupWizard.php:307| returns | void |
stepInstall()
SetupWizard.php:1151installTemplates and postInstall: the vhost install sets up on a server of yours -- and on no other.
| returns | void |
stepProject()
SetupWizard.php:462| returns | void |
stepScripts()
SetupWizard.php:1116| returns | void |
stepServers()
SetupWizard.php:481| returns | void |
stepTargets()
SetupWizard.php:844| returns | void |
stepWrite()
SetupWizard.php:1243| returns | void |
templateText($file)
SetupWizard.php:1704urlHost($url)
SetupWizard.php:1746userSshConfig()
SetupWizard.php:1666validate($changes)
SetupWizard.php:1420Refuse what mmo.admin would refuse: a deploy.json that does not load, a PHP file that does not parse.
valueAt($path)
SetupWizard.php:1618webspaceRoot($server, $row, $secrets)
SetupWizard.php:1037The folder a webspace account lands in: what pwd prints there.
withoutComments($value)
SetupWizard.php:1774write($filename, $text, $mode)
SetupWizard.php:1485Write a file beside, then move it over: a file half written is never the one read.
yes($question, $default)
SetupWizard.php:1566__construct($filename, $credentialsFilename, $templateFolder, $git, $sshConfig, $settings, $dryRun)
SetupWizard.php:131| $filename | string | the project's deploy.json, which may not exist yet. |
| $credentialsFilename = null | null | string | null: deploy.credentials.json beside it. |
| $templateFolder = null | null | string | mmo.admin's templates (null: this library's). |
| $git = null | null | Repository | the project's repository (null: the folder of deploy.json, if it is one). |
| $sshConfig = null | null | SshConfig | null: the project's deploy.ssh.config, beside deploy.json. |
| $settings = [] | array | what ProductionController is configured with: protectedTags, buildCommands, include, installTemplates, postInstall, repository (whether one is set), bootstrap (the file configuring it). |
| $dryRun = false | bool | ask everything, show every change, write nothing. |