Index

Deployment

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

class

Deployment

Deployment.php:20

One line of a target's deployment journal (Journal), stored on the target itself in deploy/deployments.json, and mirrored into the local store by SyncTask so a control panel can read the whole fleet without connecting to it.

class MMO\admin\entities\Deployment extends MMO\core\entities\Entity
Namespace
MMO\admin\entities
Extends
Entity
See
$commit is what makes it an answer rather than a hint: a version number says which release was meant, a commit sha says exactly which code is running.
This is the piece the old branch-based pipeline had no equivalent for: without a record of what was applied, `status` can only re-derive the truth by ssh-ing and parsing it back, a rollback has no target to go back to, and a database patch cannot know whether it already ran. Everything that needs to be idempotent ([`MigrateTask`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/tasks/MigrateTask.md#migratetask)) or reversible ([`RollbackTask`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/tasks/RollbackTask.md#rollbacktask)) reads it.

Index

APPLIED
FAILED
NOISEinherited Entity properties that say nothing about a deployment.
PENDING
ROLLED_BACK
artifactthe artifact's filename, so a release can be traced back to the exact tarball that produced it.
backupthe database backup taken before this deployment mutated anything.
checksumsha256 of the shipped artifact, verified on the target after transfer.
committhe git commit the release was built from -- the only unambiguous answer to "what code is live?".
dateiSO-8601 date. Stored explicitly (rather than relying on ctime) so the journal round-trips as plain JSON.
dependenciespackage name => version actually shipped in this release.
durationhow long the run took, in seconds.
errorthe failure message, when $outcome is FAILED.
hostthe machine the deployment was run FROM -- which matters when only one of them has the right assets.
librarieslibrary name => {version, commit, branch, dirty}: what each packaged library was built FROM.
outcomeone of PENDING|APPLIED|FAILED|ROLLED_BACK.
overlaysha256 of the generated assets overlaid into the release (BuildTask::$include).
patchesthe database patches applied by this deployment (ids, MigrateTask).
previousthe release that was live before this one -- what a rollback goes back to.
refthe git ref the release was built from.
releasethe release folder name on the target (usually the version).
targetthe target's name.
userwhoever ran the deployment.
versionthe package version shipped.
debugName()
getArtifact()
getBackup()
getChecksum()
getCommit()
getDate()
getDependencies()
getDirtyLibraries()
getDuration()
getError()
getHost()
getKey()
getLibraries()
getOutcome()
getOverlay()
getPatches()
getPrevious()
getRef()
getRelease()
getTarget()
getUser()
getVersion()
isApplied()
isFailed()
setOutcome($outcome, $error)
toJournal()What gets written to the target's journal.
__construct($data, $collection)

Constants5

APPLIED

const APPLIED = 'applied'

FAILED

const FAILED = 'failed'

NOISE

inherited Entity properties that say nothing about a deployment. toJournal

const NOISE = ['label', 'title', 'id', 'ctime', 'mtime', 'status', 'uid', 'metadata']

PENDING

const PENDING = 'pending'

ROLLED_BACK

const ROLLED_BACK = 'rolled-back'

Properties19

artifact

the artifact's filename, so a release can be traced back to the exact tarball that produced it.

#[MMO\core\attributes\ArrayProperty()] protected ?string $artifact = null
Type
null | string

backup

the database backup taken before this deployment mutated anything.

#[MMO\core\attributes\ArrayProperty()] protected ?string $backup = null
Type
null | string

checksum

sha256 of the shipped artifact, verified on the target after transfer.

#[MMO\core\attributes\ArrayProperty()] protected ?string $checksum = null
Type
null | string

commit

the git commit the release was built from -- the only unambiguous answer to "what code is live?".

#[MMO\core\attributes\ArrayProperty()] protected ?string $commit = null
Type
null | string

date

iSO-8601 date. Stored explicitly (rather than relying on ctime) so the journal round-trips as plain JSON.

#[MMO\core\attributes\ArrayProperty()] protected string $date = ''
Type
string

dependencies

package name => version actually shipped in this release.

#[MMO\core\attributes\ArrayProperty(schema: ['type' => 'object', 'additionalProperties' => true])] protected array $dependencies = []
Type
array
NOTE the object schema is required for a MAP: with a plain `#[ArrayProperty()]` this coerced to a list, failed, and was dropped -- every journal entry ever written recorded `"dependencies": []`.

duration

how long the run took, in seconds.

#[MMO\core\attributes\ArrayProperty()] protected ?float $duration = null
Type
null | float

error

the failure message, when $outcome is FAILED.

#[MMO\core\attributes\ArrayProperty()] protected ?string $error = null
Type
null | string

host

the machine the deployment was run FROM -- which matters when only one of them has the right assets.

#[MMO\core\attributes\ArrayProperty()] protected ?string $host = null
Type
null | string

libraries

library name => {version, commit, branch, dirty}: what each packaged library was built FROM.

#[MMO\core\attributes\ArrayProperty(schema: ['type' => 'object', 'additionalProperties' => true])] protected array $libraries = []
Type
array
A library's `.phar` is built from its folder as it is on disk ([`PackageManager::buildProject`](https://mcp.mmoframework.fr/documentation/mmo.core/php/PackageManager.md#packagemanager-buildproject)), not from a commit: its version alone does not say which code shipped. `commit` and `branch` do (null when it is no git repository, or a phar already), and `dirty` counts the uncommitted changes it was built with -- 0 unless someone chose to go on anyway ([`BuildTask::checkLibraries`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/tasks/BuildTask.md#buildtask-checklibraries)).

outcome

one of PENDING|APPLIED|FAILED|ROLLED_BACK.

#[MMO\core\attributes\ArrayProperty()] protected string $outcome = 'pending'
Type
string

overlay

sha256 of the generated assets overlaid into the release (BuildTask::$include).

#[MMO\core\attributes\ArrayProperty()] protected ?string $overlay = null
Type
null | string

patches

the database patches applied by this deployment (ids, MigrateTask).

#[MMO\core\attributes\ArrayProperty(schema: '[string]')] protected array $patches = []
Type
array

previous

the release that was live before this one -- what a rollback goes back to.

#[MMO\core\attributes\ArrayProperty()] protected ?string $previous = null
Type
null | string

ref

the git ref the release was built from.

#[MMO\core\attributes\ArrayProperty()] protected ?string $ref = null
Type
null | string

release

the release folder name on the target (usually the version).

#[MMO\core\attributes\ArrayProperty()] protected string $release = ''
Type
string

target

the target's name.

#[MMO\core\attributes\ArrayProperty()] protected string $target = ''
Type
string

user

whoever ran the deployment.

#[MMO\core\attributes\ArrayProperty()] protected string $user = ''
Type
string

version

the package version shipped.

#[MMO\core\attributes\ArrayProperty()] protected string $version = ''
Type
string

Methods27

getDirtyLibraries()

Deployment.php:163
function getDirtyLibraries(): array
returnsarraythe libraries this release was built from with uncommitted changes.

getKey()

Deployment.php:146
function getKey(): string
returnsstringwhat identifies this entry across machines, so a sync can merge without duplicating.

toJournal()

Deployment.php:136

What gets written to the target's journal.

function toJournal(): arrayNOT [`toArray`](https://mcp.mmoframework.fr/documentation/mmo.core/php/classes/aEntity.md#aentity-toarray): that adds every property `Entity` itself declares -- `label`, `title`, `status`, `id`, `ctime`, `mtime`, `metadata` and a `uid` reading `[NO COLLECTION]#[NO ID]` for an entity that has no collection, which these do not. The journal is a file people open when a deployment has gone wrong, on a server, over ssh, at an unpleasant hour: it holds what happened and nothing else.
returnsarray

__construct($data, $collection)

Deployment.php:116
function __construct(array $data = [], ?MMO\core\interfaces\iCollection $collection = null)
$data = []array
$collection = nullnull | iCollection
Inherited members (109)
ConstantsDeclared byDescription
FLAG_CHANGEDiEntity
FLAG_CREATEDiEntity
FLAG_IGNORE_CHANGEiEntity
FLAG_IGNORE_ENTITYiEntity
FLAG_OPACIFYiEntity
FLAG_REMOVEDiEntity
PropertiesDeclared byDescription
ArrayPropertiesaEntity
changesaEntity
collectionEntity
ctimeEntity
errorsaEntity
flagsaEntity
idEntityidentifier in collection
labelEntityshort name
linksaEntity
mtimeEntity
SearchPropertiesaEntity
statusaEntity
titleEntitylong name
MethodsDeclared byDescription
addFlags($flags)aEntity
addLink($link)aEntityAppend a link.
archive()aEntityThis function is called to 'delete' the entity.
ArrayProperties()aEntityBuild (once per class, then cached in the static $ArrayProperties array) the list of every #[ArrayProperty] declared on this class, its parent classes, and the traits they use -- by reflection…
ArrayProperty($name)aEntity
CheckData($data, $errors)aEntityCheck data before it touches any entity: would an entity made from $data be valid?
clearChanges()aEntityReset change tracking: clears iEntity::FLAG_CHANGED and forgets every recorded change.
compareTo($value)aEntityCompare value
conversionError($key, $e)aEntityThe error recorded for a value that could not be set at all (usually: it could not be converted to its property's type), in the same form as a validation error.
Copy($entity, $properties)EntityBuild a new entity from $entity's own stored data (a duplicate, minus its id -- so saving it creates a genuinely new record -- in the same collection).
get($path, $default)aEntityRead a (possibly nested) value by json-path, e.g.
getArrayProperty($key, $isRef, $store)aEntityRead a single array property's current value, through its getter (a direct property, a path alias, or a method).
getChanges($asArray, $store)aEntity
getCollection()Entity
getCtime()Entity
getErrors()aEntity
getFlags()aEntity
getId()Entity
getLabel()Entity
getLinks()aEntity
getLinksByRel($rels, $all)aEntityGet a list of Reference that have a specific relationship.
getMetadata()aEntity
getMtime()Entity
getRepository()Entity
getStatus()aEntity
getTitle()Entity
getView()aEntity
hasChanged($keys)aEntity
hasFlags($flags, $strict)aEntity
hasStatusChanged()aEntity
HiddenPath($path)aEntityThe hidden property (ArrayProperty::isHidden) a json-path goes through, known from the declared types alone: of this class, or of a class a property on the way may hold -- every class of its t…
ignore()EntityIgnore everything about this entity: discard its pending changes and flag it so it's skipped by future commits (aRepository::onCommit).
ignoreChanges($value)aEntityTemporarily suppress markChanged (used e.g.
isActive()aEntity
isArchive()aEntity
isArrayPropertySet($key, $store)EntitySame as aEntity::isArrayPropertySet, but 'ctime'/'mtime' are never reported as "set" (they're always present, so listing them adds no information), and neither is 'id' once the entity is alrea…
isChanged()aEntity
isCreated()aEntity
isDraft()aEntity
isEmpty()aEntity
isFinal()aEntity
isHiddenPath($path)aEntity
isIgnored()Entity
isOpacified()aEntity
isPending()aEntity
isRemoved()aEntity
isSimilar($value)Entity
isUnique()aEntityTells if an entity has enough information to be unique (at least one unique group has no null)
isValid()aEntity
isValidated()aEntity
ListClassReferences($onlyStorable)aEntityGet a list of all the classes and their properties that are using references to this class.
loadArray($data, $coerceOptions, $fromStore)EntitySame as aEntity::loadArray, but 'ctime'/'mtime' are never taken from $data: they belong to the server (set when the entity is created, bumped by markChanged), and a client sending back th…
loadFromStore($data)EntityRestore from stored data, setting 'ctime'/'mtime' directly (bypassing their normal setters -- see setCtime/setMtime, which are read-only via #[ArrayProperty]).
localName()Entity
loopReferences()EntityYield all the entities in the repository that have a reference on this one.
markChanged($keys)EntitySame as aEntity::markChanged, also bumping $mtime to now -- unless the change itself was to 'ctime'/'mtime' (avoiding infinite recursion via setMtime's own markChanged call).
mutate($type, $path, $value, $oldValue)aEntity\MMO\core\interfaces\iMutationObserver::mutate -- besides the normal tArrayProperties::mutate behavior, walks up $path to find the nearest enclosing aEntity (the mutation may have happened dee…
offsetExists($key)aEntity\ArrayAccess::offsetExists -- tells whether $key is a *declared* #[ArrayProperty], not whether it currently holds a non-default value (use isArrayPropertySet for that).
offsetGet($key)aEntity\ArrayAccess::offsetGet
offsetSet($key, $value)aEntity\ArrayAccess::offsetSet
offsetUnset($key)aEntity\ArrayAccess::offsetUnset -- equivalent to setting the property to null (its coerced value depends on the property's schema: e.g.
opacify($value)aEntityHide this entity's properties from toArray output (typically used to redact an entity the current viewer isn't allowed to see the details of, while still letting it be referenced by uid/metadata).
push($path, $value)aEntityAppend a value to a (possibly nested) list property by json-path.
reload()EntityReload entity from its repository
removeFlags($flags)aEntity
removeLink($link)aEntityRemove a link (by identity).
removePermanently($force)EntityRemove entity from database
replaceBy($replace, $mergeData)EntityReplace this entity by another one, trying to change all references to this entity to the new one.
Schema()aEntityThe JSON-Schema describing every #[ArrayProperty] of this class (built once and cached by ArrayProperties).
SearchProperty($name)aEntity
set($path, $value)aEntityWrite a (possibly nested) value by json-path, creating intermediate structure as needed.
setArrayProperty($key, $value, $coerceOptions, $ignoreReadonly)aEntitySame as tArrayProperties::setArrayProperty, plus: any coercion/validation failure is caught and recorded in getErrors (making the entity isValid()-false) instead of propagating as an…
setArrayPropertyOffset($key, $offset, $value, $coerceOptions)aEntitySame as tArrayProperties::setArrayPropertyOffset, plus: when pushing (offset === null) a new entity onto a list property, if an existing item is isSimilar to the new value, that item's of…
setCollection($collection, $removeFromCollection)EntityMove this entity to (or out of, if null) a collection.
setCtime($date, $force)EntitySet creation time
setId($id)EntitySet the id, re-registering this entity in its $collection under the new id (Collection's entities are keyed by id).
setLinks($links)aEntityReplace every link with $links.
setMtime($date, $force)EntitySet modification time
setStatus($status)aEntity
store()aEntityExport all array properties with store set to true.
test($filter)aEntity
toArray($fields, $flatten, $recursive)aEntitySame as tArrayProperties::toArray, except an isOpacified entity always exports only its 'uid' and 'metadata' (its other properties are hidden from output).
toLink($attributes)aEntity
traitMutate($type, $path, $value, $oldValue)aEntity\MMO\core\interfaces\iMutationObserver::mutate -- reacts to a mutation that happened deep inside one of this object's array properties (e.g.
traitSetArrayProperty($key, $value, $coerceOptions, $fromStore)aEntitySet array property
traitSetArrayPropertyOffset($key, $offset, $value, $coerceOptions)aEntitySet/push a value into an array property
traitToArray($fields, $flatten, $recursive)aEntityExport fields to an array.
uid()Entity
validate($errors)aEntityValidate this entity: its current values against its own tArrayProperties::Schema, plus every value that could not even be set -- one that could not be converted to its property's type never r…
View()aEntity