MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

Context

MMO\admin\helpers · 1 symbole · générée le 27 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
Espace de noms
MMO\admin\helpers
Voir
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

Propriétés23

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

scripts

array $scripts = []
Type
array

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

Méthodes10

getRelease()

Context.php:85

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
Voir
ProductionController::printStatus, exactly like the target having drifted).
retournestring

getReleaseFolder()

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

option($name, $default)

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

say($message, $context)

Context.php:112

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
retournevoid

toDeployment($outcome, $error)

Context.php:128

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
retourneDeployment

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

Context.php:57
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