Index

Server

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

class

Server

Server.php:34

A machine deployment targets live on -- declared once, and referenced by every Target it hosts.

class MMO\admin\entities\Server extends MMO\core\entities\Entity
Namespace
MMO\admin\entities
Extends
Entity
See
$fingerprint is the one security-relevant field that IS safe to commit, and should be: without it, every connection trusts whatever host answers on that address.
Splitting this out of `Target` is what lets a control panel answer "which clients are on which machine, and what happens if that machine dies", which a per-target `"shell": "#ssh"` config path could not express: 27 targets all pointing at `#ssh` looked like 27 independent things while actually sharing one host. **This entity never holds a secret.** [`$auth`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Server.md#server-auth) names a METHOD, not a value: - `agent` -- the local ssh-agent, with the host details taken from the project's `deploy.ssh.config` ([`$sshAlias`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Server.md#server-sshalias)), or from deploy.json. Nothing secret exists in any file the project owns. This is the recommended one. - `key` -- a private key whose PATH comes from the git-ignored credentials file ([`Credentials`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Credentials.md#credentials)). - `password` -- a password that comes from the credentials file, and from nowhere else. A `password` (or `privateKey`, or any other secret-shaped key) written directly into `deploy.json` is rejected when the file is read ([`Store::assertNoSecrets`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Store.md#store-assertnosecrets)), rather than accepted with a warning -- that exact shortcut is how the previous pipeline's production password ended up on 31 branches.

Index

AUTHS
AUTH_AGENT
AUTH_KEY
AUTH_PASSWORD
authone of AUTHS -- a method, never a secret.
credentials
fingerprintthe server's host key fingerprint (MD5 or SHA1 hex, colons optional), verified before authenticating.
handle
hostthe hostname or ip (may be omitted when $sshAlias supplies it).
managedtrue when the web server on this machine is the HOST's, not ours: a shared webspace (IONOS Hébergement Web, OVH mutualisé, o2switch, ...) where ssh exists but sudo, systemctl, a vhost and `/e…
namethe server's identifier, referenced by Target::$server.
portthe ssh port (null: the alias's, else 22).
rootthe folder every relative path of a target on this server starts from: /var/www on a server of yours, the account's home on a webspace -- what pwd prints there, which setup reads.
shellan explicit iShell configuration path, bypassing everything above: local for this machine, or a configuration key (#ssh) for a shell wired by hand.
sshAliasthe Host entry of the project's deploy.ssh.config supplying host/port/user/key (SshConfig).
sshConfig
tagsfree-form labels, e.g.
user
credential($key, $required)
credentialsFilename()
debugName()
getAddress()
getAliasSettings()
getAuth()
getFingerprint()
getHost()
getName()
getPort()
getRoot()
getShell()The shell used to reach this server, built once.
getShellPath()
getSshAlias()
getSshConfig()
getTags()
getUser()
isLocal()
isManaged()
newSSH()
setCredentials($credentials)
setShell($shell)
setSshConfig($sshConfig)

Constants4

AUTHS

const AUTHS = ['agent', 'key', 'password']

AUTH_AGENT

const AUTH_AGENT = 'agent'

AUTH_KEY

const AUTH_KEY = 'key'

AUTH_PASSWORD

const AUTH_PASSWORD = 'password'

Properties14

auth

one of AUTHS -- a method, never a secret.

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

credentials

#[MMO\core\attributes\NoDump()] protected ?MMO\admin\helpers\Credentials $credentials = null
Type
null | Credentials

fingerprint

the server's host key fingerprint (MD5 or SHA1 hex, colons optional), verified before authenticating.

#[MMO\core\attributes\ArrayProperty()] protected ?string $fingerprint = null
Type
null | string
Public data: commit it. Without it a connection cannot tell the real server from anything that answers on its address.

handle

#[MMO\core\attributes\NoDump()] protected ?MMO\core\interfaces\iShell $handle = null
Type
null | iShell

host

the hostname or ip (may be omitted when $sshAlias supplies it).

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

managed

true when the web server on this machine is the HOST's, not ours: a shared webspace (IONOS Hébergement Web, OVH mutualisé, o2switch, ...) where ssh exists but sudo, systemctl, a vhost and /etc/apache2 do not.

#[MMO\core\attributes\ArrayProperty()] protected bool $managed = false
Type
bool
It changes nothing about how the machine is REACHED -- a webspace is an ordinary [`SSH`](https://mcp.mmoframework.fr/documentation/mmo.core/php/server/SSH.md#ssh) target, and a release still travels as one tarball. What it changes is what the pipeline is allowed to ASSUME about it: - there is no service to reload, so a target declaring no `reload` is normal rather than suspicious; - `127.0.0.1` is not this site. On a machine of ours the post-activation probe deliberately goes to the loopback with a `Host:` header, because that exercises THIS vhost rather than whatever a cache answers. On a webspace there is no vhost of ours to exercise -- the loopback answers the provider's default host, or nothing -- and a perfectly good release would be rolled back for it. So the probe moves to the deploying machine and the public url becomes authoritative ([`Target::getProbe`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-getprobe)); - the document root is fixed in the provider's control panel and cannot be pointed at a release folder by editing a vhost, which is what [`Target::$webRoot`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Target.md#target-webroot) exists for. It is declared on the SERVER rather than on each target because it is a property of the machine: every site on one webspace shares the one thing that matters here -- that its web server belongs to someone else.

name

the server's identifier, referenced by Target::$server.

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

port

the ssh port (null: the alias's, else 22). Not 22 by default: that would always win over the alias's own.

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

root

the folder every relative path of a target on this server starts from: /var/www on a server of yours, the account's home on a webspace -- what pwd prints there, which setup reads. null: every target on it gives absolute paths.

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

shell

an explicit iShell configuration path, bypassing everything above: local for this machine, or a configuration key (#ssh) for a shell wired by hand. The escape hatch for anything this entity does not model (a jump host, a container, a bastion).

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

sshAlias

the Host entry of the project's deploy.ssh.config supplying host/port/user/key (SshConfig).

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

sshConfig

#[MMO\core\attributes\NoDump()] protected ?MMO\admin\helpers\SshConfig $sshConfig = null
Type
null | SshConfig

tags

free-form labels, e.g. 'ovh', 'eu-west'.

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

user

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

Methods23

credential($key, $required)

Server.php:265
protected function credential(string $key, bool $required = false): ?string
$keystring
$required = falsebool
returnsnull | stringa secret for this server, from the git-ignored credentials file only.

getAddress()

Server.php:156
function getAddress(): string
returnsstringhow a human should read this server's address, without revealing anything.

getAliasSettings()

Server.php:168
function getAliasSettings(): array
returnsarraythe deploy.ssh.config entry backing this server, or [] when there is none.

getShell()

Server.php:177

The shell used to reach this server, built once.

function getShell(): MMO\core\interfaces\iShell
returnsiShell
throwswhen the server cannot be reached with what it declares.

isManaged()

Server.php:146
function isManaged(): bool
returnsboolwhether the web server on this machine belongs to the host rather than to us. $managed

newSSH()

Server.php:198
protected function newSSH(): MMO\core\server\SSH
returnsSSHbuilt from this server's declaration plus, for anything secret, the credentials file.
throws
Inherited members (110)
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
__construct($data, $collection)Entity