Index

Context

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

class

Context

Context.php:16

Everything one task needs to act on one target, and the place tasks hand results to each other:

class MMO\admin\helpers\Context
Namespace
MMO\admin\helpers
See
BuildTask fills $artifact, ShipTask reads it and fills $release,, ActivateTask reads that and fills $previous, and Runner turns the whole thing into one Deployment journal entry at the end.
A context is built once per (run, target) by the runner -- never by a task.

Index

artifact
backup
checksum
commit
dependencies
dryRun readonly
interactive readonly
journal readonly
libraries
live
local readonly
lock readonly
options
overlay
patches
previous
release
repository readonly
shell readonly
startedAt readonly
target readonly
version
debugName()
error($message, $context)
getName()
getRelease()The release this run is about.
getReleaseFolder()
isForced()
option($name, $default)
say($message, $context)Print a message prefixed with the target's name, so a fan-out stays readable.
toDeployment($outcome, $error)Turn what the tasks recorded into the journal entry for this run.
__construct($target, $dryRun, $interactive, $repository)

Properties22

dependencies

array $dependencies = []
Type
array

dryRun

readonly
readonly bool $dryRun
Type
bool

interactive

readonly
readonly bool $interactive
Type
bool

journal

readonly
readonly MMO\admin\helpers\Journal $journal
Type
Journal

libraries

array $libraries = []
Type
array

live

protected ?string $live = null
Type
null | string

local

readonly
readonly MMO\core\server\ShellRunner $local
Type
ShellRunner

lock

readonly
readonly MMO\admin\helpers\RemoteLock $lock
Type
RemoteLock

options

array $options = []
Type
array

patches

array $patches = []
Type
array

release

string $release = ''
Type
string

repository

readonly
readonly ?MMO\core\interfaces\iRepository $repository
Type
null | iRepository

shell

readonly
readonly MMO\core\server\ShellRunner $shell
Type
ShellRunner

startedAt

readonly
readonly float $startedAt
Type
float

target

readonly
readonly MMO\admin\entities\Target $target
Type
Target

version

string $version = ''
Type
string

Methods10

getRelease()

Context.php:83

The release this run is about.

function getRelease(): stringA run that ships nothing -- a database migration, a backup, a `cmd` -- still belongs to whatever release is live, so it is recorded against that one rather than against an empty string (which would look, to
See
ProductionController::printStatus, exactly like the target having drifted).
returnsstring

getReleaseFolder()

Context.php:94
function getReleaseFolder(): string
returnsstringthe absolute path of this run's release folder on the target.

option($name, $default)

Context.php:101
function option(string $name, mixed $default = null): mixed
$namestring
$default = nullmixed
returnsmixeda command-line option passed to this run.

say($message, $context)

Context.php:110

Print a message prefixed with the target's name, so a fan-out stays readable.

function say(string $message, array $context = []): void
$messagestring
$context = []array
returnsvoid

toDeployment($outcome, $error)

Context.php:126

Turn what the tasks recorded into the journal entry for this run.

function toDeployment( string $outcome = MMO\admin\entities\Deployment::APPLIED, ?string $error = null ): MMO\admin\entities\Deployment
$outcome = MMO\admin\entities\Deployment::APPLIEDstringDeployment::APPLIED / FAILED / ROLLED_BACK
$error = nullnull | string
returnsDeployment

__construct($target, $dryRun, $interactive, $repository)

Context.php:55
function __construct( MMO\admin\entities\Target $target, bool $dryRun = false, bool $interactive = false, ?MMO\core\interfaces\iRepository $repository = null )
$targetTarget
$dryRun = falsebool
$interactive = falsebool
$repository = nullnull | iRepository