SetupWizard
MMO\admin\helpers · 1 symbole · générée le 27 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.
- Espace de noms
MMO\admin\helpers
Index
Constantes4
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.
Propriétés24
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
Méthodes97
address($row)
SetupWizard.php:1689aliasSettings($row)
SetupWizard.php:1682apply($changes)
SetupWizard.php:1472ask($question, $default, $validate)
SetupWizard.php:1549askAlias($server, $row, $was)
SetupWizard.php:591askAuth($row, $secrets)
SetupWizard.php:634askFingerprint($row)
SetupWizard.php:698askHost($row)
SetupWizard.php:621askList($question, $default, $validate)
SetupWizard.php:1553askManaged($row)
SetupWizard.php:690askPort($question, $default)
SetupWizard.php:1557askRoot($server, $row, $secrets, $local)
SetupWizard.php:796The folder every relative path of a target on this server starts from.
askVhost($template)
SetupWizard.php:1213Make 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:999What a target on a shared webspace needs that the others do not.
bootstrapFilename()
SetupWizard.php:1710| retourne | string |
branch()
SetupWizard.php:1704changes()
SetupWizard.php:1299Every 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.
| retourne | array | array{label: string, old: string, new: string, mode?: int, secret?: bool, template?: bool}> by filename. |
checkAgent()
SetupWizard.php:678Say whether an ssh agent is running and holds a key: agent needs both, and neither is in a file to check later.
| retourne | void |
checkAttributes()
SetupWizard.php:392| retourne | void |
checkCredentialsFile()
SetupWizard.php:452| retourne | void |
checkHook()
SetupWizard.php:433| retourne | void |
checkIgnored()
SetupWizard.php:342| retourne | 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.
| retourne | void |
checkRef($ref)
SetupWizard.php:1102Warn about a branch this repository does not have: the first release of the target would fail on it.
closest($key, $known)
SetupWizard.php:1743conclude()
SetupWizard.php:1514What to do next, in order, with the commands to type.
| retourne | void |
credentialsText()
SetupWizard.php:1404debugName()
SetupWizard.php:150| retourne | string |
declarationText()
SetupWizard.php:1389| retourne | 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:1721describeServer($row)
SetupWizard.php:535directive($text, $pattern, $value)
SetupWizard.php:1248editServer($name)
SetupWizard.php:548editTarget($name)
SetupWizard.php:898entity($name, $row)
SetupWizard.php:1597expand($path)
SetupWizard.php:1728fingerprint($value)
SetupWizard.php:780| $value | string | a fingerprint as a tool prints it: MD5:aa:bb..., AABB..., with or without colons. |
| retourne | 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:1737hasDatabase()
SetupWizard.php:1658| retourne | bool |
hostKeyFile($type)
SetupWizard.php:767ignoresNeeded()
SetupWizard.php:1363The .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.
| retourne | array |
ignoreText($rule)
SetupWizard.php:370introduce($full)
SetupWizard.php:221isExample($section, $name)
SetupWizard.php:1649isHost($host)
SetupWizard.php:1772isIgnored($file)
SetupWizard.php:375isUrl($url)
SetupWizard.php:1768listServers()
SetupWizard.php:518| retourne | void |
listTargets()
SetupWizard.php:880| retourne | void |
load()
SetupWizard.php:199| retourne | void |
manifest()
SetupWizard.php:1696| retourne | array | the project's mmo.json, or nothing. |
mask($text)
SetupWizard.php:1468missingRules($template, $have)
SetupWizard.php:417The rules of the template a project's .gitattributes lacks. A rule the template anchors to the root (/src/ export-ignore) is there when the project has it bare (src/ export-ignore): bare, it matches at any depth, the root included -- broader than the template asks, which is the project's own choice.
missingTemplates()
SetupWizard.php:327| retourne | array | file relative to the project => template, for every template file the project lacks. |
moveSecret($path, $key, $what)
SetupWizard.php:289need($answer)
SetupWizard.php:1544objectify($data)
SetupWizard.php:1608panelPath($path, $root)
SetupWizard.php:1097pick($question, $options, $default)
SetupWizard.php:1561pickName($question, $names, $default)
SetupWizard.php:1571privateFiles()
SetupWizard.php:362| retourne | 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:1654| retourne | array | the tags that protect a target. |
readHostKey($host, $port)
SetupWizard.php:738Read the host key a server presents, the way the deployment's own connection will check it.
readWebspaceRoot($server, $row, $secrets)
SetupWizard.php:1068reference($path)
SetupWizard.php:1642relative($filename)
SetupWizard.php:1732relativePaths($paths)
SetupWizard.php:1777relativeTo($root, $path, $default)
SetupWizard.php:1089| $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. |
| retourne | 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:839removeTarget($name)
SetupWizard.php:1120renameKey($values, $old, $new)
SetupWizard.php:1622review($changes)
SetupWizard.php:1450Show every change: what is added, removed, run -- secrets masked.
rules($text)
SetupWizard.php:424run($only)
SetupWizard.php:158Ask, explain, show, write.
saveServer($old, $new, $row, $secrets)
SetupWizard.php:819saveTarget($old, $new, $row)
SetupWizard.php:1110secret($question)
SetupWizard.php:1581setting($key)
SetupWizard.php:1666sshConfig()
SetupWizard.php:1672| retourne | SshConfig |
step($step)
SetupWizard.php:186stepFiles()
SetupWizard.php:307| retourne | void |
stepInstall()
SetupWizard.php:1162installTemplates and postInstall: the vhost install sets up on a server of yours -- and on no other.
| retourne | void |
stepProject()
SetupWizard.php:473| retourne | void |
stepScripts()
SetupWizard.php:1127| retourne | void |
stepServers()
SetupWizard.php:492| retourne | void |
stepTargets()
SetupWizard.php:855| retourne | void |
stepWrite()
SetupWizard.php:1254| retourne | void |
templateText($file)
SetupWizard.php:1715urlHost($url)
SetupWizard.php:1757userSshConfig()
SetupWizard.php:1677validate($changes)
SetupWizard.php:1431Refuse what mmo.admin would refuse: a deploy.json that does not load, a PHP file that does not parse.
valueAt($path)
SetupWizard.php:1629webspaceRoot($server, $row, $secrets)
SetupWizard.php:1048The folder a webspace account lands in: what pwd prints there.
withoutComments($value)
SetupWizard.php:1785write($filename, $text, $mode)
SetupWizard.php:1496Write a file beside, then move it over: a file half written is never the one read.
yes($question, $default)
SetupWizard.php:1577__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. |