ProjectRuns
MMO\admin\monitoring · 1 symbol · generated 30 Nov 2026
ProjectRuns
ProjectRuns.php:29What a hub may run on its project, checked out on this machine (LocalProject): a closed list (RUNS), each written here as the project's own command line -- its tests, php scripts/admin.php <command> for its deployments, git for its branch. The page and php hub.php run only name a run and pick its targets: they never send a command, but to cmd, admin.php's own: the command typed is run on the sites named, as its --exec=, once confirmed.
- Namespace
MMO\admin\monitoring
Index
| BACKUPS | the runs that change a site's backups: applied, each site's backups are read again after it (BackupInventory) | |
| BATCHED | the runs made of one process per site (executeBatch): what acts on each site alone | |
| DATA | the runs that move a site's data (admin.php's data-*): applied, each site's status is read again after it | |
| DUMP | a dump --file= names: a file name of a backup folder, no path | |
| MAX_CONCURRENCY | the most sites a batch runs at once, whatever is asked | |
| PARTS | what version --part= increases | |
| PREBUILT | the batches that build every site's artifact first, in one pass: a build shares the libraries' cached phars | |
| RELEASE | a release name --to= names: what admin.php's releases are called | |
| REPORTED | the runs each result of which is also kept as a dated report ({data}/project/reports/{run}/{date}.json): evidence | |
| RUNS | run => what it is: label, changes (whether it changes something: a dry run by default, then confirmed; on sites, their names typed again unless confirm is false: what writes only here, or add… | |
| SIDES | a data run's side that wins what both changed differently (admin.php's --prefer=) | |
| WHERE | where a backup run deletes: a site's server, this machine, both (admin.php's --where=) | |
| project | ||
| audit($say, $result) | The project's third-party dependencies against the known vulnerabilities: composer audit when it has a composer.json, npm audit when it has a package.json (each when its tool is there). | |
| concurrency($names) | How many sites a batch runs at once by default: what each server can take -- its free processors, from its last reading (cpu.count, load.perCpu), two per site, one to four; one when it was neve… | |
| confirmation($typed) | ||
| debugName() | ||
| decrypt($file, $config, $say) | ||
| domains($say, $result) | When each domain of the sites expires: their registry's RDAP answer (rdap.org finds it), one question a domain. | |
| drift($say, $result) | For each site asked (every one when none is), the keys of its live configs/prod.json against the same file at its ref: keys only, never their values -- they are its secrets. | |
| dumps($target) | A site's dumps, to restore one (restore's file): those of its server's backup folder, newest first, then those of this machine's backups (a backup fetched here), which admin.php uploads before … | |
| execute($run, $options, $say, $progress, $stop) | Run a run's steps one after the other, saying each line they print; stop at the first that fails, or when asked. | |
| executeBatch($run, $options, $say, $progress, $stop) | A run of BATCHED: each site its own process, several at a time, the others going on when one fails. | |
| flushSite($site, $say) | Say what a site printed last, without its end of line. | |
| getFolder() | ||
| getProject() | ||
| i18n($say, $result) | ||
| IsChatter($line) static | ||
| keepBackups($name, $json, $code, $result, $say) | Keep what backups -m read of a site (BackupInventory): unknown with why when it was not read. | |
| keepDataStatus($name, $json, $code, $result, $say) | Keep what data-status -m read of a site (SyncStatus): unknown with why when it was not read. | |
| keepTypes($name, $json, $code, $result, $say) | Keep what section-types -m read of a site (TypeOverrideStatus): unknown with why when it was not read. | |
| Keys($data, $prefix) static | ||
| last($run) | ||
| lastOf($target, $run) | ||
| lastSuccess($run) | ||
| lint($say) | ||
| LocalCpus() static | ||
| options($run, $options) | The options of a run, checked: nothing but what this class knows reaches a command line. | |
| packageFolder($package) | ||
| php() | ||
| phpstanSteps() | ||
| phpunit() | ||
| Plain($line) static | ||
| process($command, $cwd, $say, $stop, $capture) | ||
| reports($run) | ||
| restoreChecks($commands, $values, $say) | The project's checks of a restored dump: each a command line of the hub's restoreTest.checks, its placeholders replaced (each value quoted), run in the project's folder. | |
| restoreTest($say, $result) | Whether a backup restores (ISO 27001 A.8.13): the newest dump of the site asked (or of any site) among the project's local dumps (what backup --fetch brings: .mongo, or .mongo.age encrypted o… | |
| runSites($run, $options, $names, $total, $servers, $result, $states, $say, $report, $stop) | Run some sites of a batch, each its own process: at most $total at once, and at most a server's slots on it. | |
| save($run, $result) | Keep a run's result: the last one of each run, and a dated report of those of REPORTED. | |
| saveTarget($target, $run, $record) | Keep one site's outcome of a batch: the last of each run, per site, which another batch of other sites leaves as it is. | |
| sets($target) | A site's backup sets (BackupSets): from its server's backups and this machine's, newest first. | |
| siteLine($site, $name, $type, $line, $say) | One line a site printed: its json kept (data-status, section-types), the framework's chatter left out, the rest said and kept. | |
| startSite($run, $options, $name, $server, $say, $before, $code) | ||
| steps($run, $options) | The steps of a run: each a command line, run in a folder; or call, run in this process. | |
| testsStep() | ||
| __construct($project) |
Constants12
BACKUPS
the runs that change a site's backups: applied, each site's backups are read again after it (BackupInventory)
BATCHED
the runs made of one process per site (executeBatch): what acts on each site alone
DATA
the runs that move a site's data (admin.php's data-*): applied, each site's status is read again after it
DUMP
a dump --file= names: a file name of a backup folder, no path
MAX_CONCURRENCY
the most sites a batch runs at once, whatever is asked
PARTS
what version --part= increases
PREBUILT
the batches that build every site's artifact first, in one pass: a build shares the libraries' cached phars
RELEASE
a release name --to= names: what admin.php's releases are called
REPORTED
the runs each result of which is also kept as a dated report ({data}/project/reports/{run}/{date}.json): evidence
RUNS
run => what it is: label, changes (whether it changes something: a dry run by default, then confirmed; on sites, their names typed again unless confirm is false: what writes only here, or adds without replacing), targets (whether it acts on the sites of deploy.json: --targets=), remote (whether it reaches the servers)
SIDES
a data run's side that wins what both changed differently (admin.php's --prefer=)
WHERE
where a backup run deletes: a site's server, this machine, both (admin.php's --where=)
Properties1
project
- Type
- LocalProject
Methods43
audit($say, $result)
ProjectRuns.php:826The project's third-party dependencies against the known vulnerabilities: composer audit when it has a composer.json, npm audit when it has a package.json (each when its tool is there).
concurrency($names)
ProjectRuns.php:580How many sites a batch runs at once by default: what each server can take -- its free processors, from its last reading (cpu.count, load.perCpu), two per site, one to four; one when it was never read -- up to the sites it hosts, added up, and no more than this machine's processors but one (each site is a php process here).
confirmation($typed)
ProjectRuns.php:198debugName()
ProjectRuns.php:106| returns | string |
decrypt($file, $config, $say)
ProjectRuns.php:787domains($say, $result)
ProjectRuns.php:850When each domain of the sites expires: their registry's RDAP answer (rdap.org finds it), one question a domain.
drift($say, $result)
ProjectRuns.php:696For each site asked (every one when none is), the keys of its live configs/prod.json against the same file at its ref: keys only, never their values -- they are its secrets. Read over ssh, read only.
dumps($target)
ProjectRuns.php:935A site's dumps, to restore one (restore's file): those of its server's backup folder, newest first, then those of this machine's backups (a backup fetched here), which admin.php uploads before restoring.
execute($run, $options, $say, $progress, $stop)
ProjectRuns.php:308Run a run's steps one after the other, saying each line they print; stop at the first that fails, or when asked.
executeBatch($run, $options, $say, $progress, $stop)
ProjectRuns.php:371A run of BATCHED: each site its own process, several at a time, the others going on when one fails.
flushSite($site, $say)
ProjectRuns.php:516Say what a site printed last, without its end of line.
getFolder()
ProjectRuns.php:877| returns | string | the folder keeping the runs' results: the hub's data, project/ |
getProject()
ProjectRuns.php:108| returns | LocalProject |
i18n($say, $result)
ProjectRuns.php:675IsChatter($line)
staticProjectRuns.php:644keepBackups($name, $json, $code, $result, $say)
ProjectRuns.php:564Keep what backups -m read of a site (BackupInventory): unknown with why when it was not read.
keepDataStatus($name, $json, $code, $result, $say)
ProjectRuns.php:539Keep what data-status -m read of a site (SyncStatus): unknown with why when it was not read.
keepTypes($name, $json, $code, $result, $say)
ProjectRuns.php:551Keep what section-types -m read of a site (TypeOverrideStatus): unknown with why when it was not read.
Keys($data, $prefix)
staticProjectRuns.php:725last($run)
ProjectRuns.php:961lastOf($target, $run)
ProjectRuns.php:904| $target | string | |
| $run | string | |
| returns | null | array | a site's last outcome of a run (saveTarget), null when the run never reached it |
lastSuccess($run)
ProjectRuns.php:919lint($say)
ProjectRuns.php:654LocalCpus()
staticProjectRuns.php:602| returns | int | this machine's processors |
options($run, $options)
ProjectRuns.php:127The options of a run, checked: nothing but what this class knows reaches a command line.
| $run | string | one of RUNS |
| $options | array | parts (backup, restore of a set: databases, files, config; all by default), set (restore: a backup set's time, or latest: each site's own; instead of file, one dump of one site), prefer (a data run: local or target wins what both sides changed differently; none: a site with such a change is left as it is and fails -- data-merge needs one), withFiles (a data run: the sites' sync.optional paths too), concurrency (a batch's sites at once, concurrency by default), canary (a batch that changes the sites tries the first one alone: true by default), targets (names of deploy.json, a list or a,b), dryRun (true by default for a run that changes something), confirm (the targets' names typed again: a,b), to (rollback's release), fetch (backup's), package (pull/push: the project, or one of its libraries), restoreLocally (backup's: the dump into this machine's database), file (restore's dump, on the target or in the local backups), exec (cmd's command, one line), part (version's: patch, minor, major), count (history's entries) |
| returns | array | list<string>, dryRun: bool, confirmed: bool, to: ?string, fetch: bool, package: string, restoreLocally: bool, file: ?string, exec: ?string, part: string, count: int} |
| throws | for an unknown run, target, release or package, or a run that changes something asked without its confirmation |
packageFolder($package)
ProjectRuns.php:256php()
ProjectRuns.php:261| returns | string | the php command line binary: this one on the command line, the cli one beside it under a web server |
phpstanSteps()
ProjectRuns.php:284| returns | array | phpstan, when the project has its configuration and the phar is there (its own, or its libraries' clone's) |
phpunit()
ProjectRuns.php:275| returns | string | the project's phpunit: its vendor's, its libraries' clone's, else the one on the PATH |
Plain($line)
staticProjectRuns.php:649process($command, $cwd, $say, $stop, $capture)
ProjectRuns.php:611reports($run)
ProjectRuns.php:912restoreChecks($commands, $values, $say)
ProjectRuns.php:810The project's checks of a restored dump: each a command line of the hub's restoreTest.checks, its placeholders replaced (each value quoted), run in the project's folder.
restoreTest($say, $result)
ProjectRuns.php:747Whether a backup restores (ISO 27001 A.8.13): the newest dump of the site asked (or of any site) among the project's local dumps (what backup --fetch brings: .mongo, or .mongo.age encrypted on its server), decrypted here with the hub's restoreTest.identity (the age private key of this machine, else MMO_BACKUP_IDENTITY) into a temporary file, restored into a scratch database of this machine's MongoDB, its collections counted, then restoreTest.checks run on it (the project's own, {database} the scratch database: my.oviepro's php admin.php data-guard ...), then dropped (restoreTest.prefix and the dump's database name: mmo_restoretest_{database}). Nothing of the project's own database is touched. Each test is kept as a dated report (reports), and the last one that passed is what the pages and the readiness show (lastSuccess).
runSites($run, $options, $names, $total, $servers, $result, $states, $say, $report, $stop)
ProjectRuns.php:435Run some sites of a batch, each its own process: at most $total at once, and at most a server's slots on it.
save($run, $result)
ProjectRuns.php:885Keep a run's result: the last one of each run, and a dated report of those of REPORTED.
saveTarget($target, $run, $record)
ProjectRuns.php:897Keep one site's outcome of a batch: the last of each run, per site, which another batch of other sites leaves as it is.
sets($target)
ProjectRuns.php:956A site's backup sets (BackupSets): from its server's backups and this machine's, newest first.
siteLine($site, $name, $type, $line, $say)
ProjectRuns.php:523One line a site printed: its json kept (data-status, section-types), the framework's chatter left out, the rest said and kept.
startSite($run, $options, $name, $server, $say, $before, $code)
ProjectRuns.php:495| $run | string | |
| $options | array | |
| $name | string | |
| $server | string | |
| $say | callable | |
| $before = null | null | array | the site's step before (steps' after): its lines, its json and its code carried on |
| $code = null | null | int | what the site ends with, whatever this step ends with (a step after) |
| returns | array | string, process: Process, command: string, server: string, began: float, lines: \ArrayObject<int, string>, json: \ArrayObject<string, mixed>, buffers: \ArrayObject<int, string>, after: list<array>, code: ?int} one site's process, started |
steps($run, $options)
ProjectRuns.php:210The steps of a run: each a command line, run in a folder; or call, run in this process.
testsStep()
ProjectRuns.php:266| returns | array | string, command: string, cwd: string, junit: string} the project's phpunit, its results as junit |
__construct($project)
ProjectRuns.php:104| $project | LocalProject |