Target
MMO\admin\entities · 1 symbol · generated 5 Oct 2026
Target
Target.php:44One deployment target: a folder, on a Server, that a release is shipped to.
Index
| DEFAULT_WEB_ROOT | what a managed server's target serves when it says nothing: a folder of its own folder. | |
| NO_WEB_ROOT | what a target writes as its webRoot to have none, managed server or not. | |
| PROBES | ||
| PROBE_LOCAL | it runs on the DEPLOYING machine, against the public url only -- the only thing a webspace can prove. | |
| PROBE_NONE | it does not run: the release is considered good once current points at it. | |
| PROBE_TARGET | the post-activation http probe runs on the target itself, against 127.0.0.1 and against the url. | |
| SAFE | what a target name, and any vars value, is allowed to contain. | |
| database | the database name on the target (null: this target has no database). | |
| enabled | false to keep the target declared but excluded from every TAG-based fan-out (Targets::select). | |
| folder | the target's own folder, holding releases/, current, deploy/ -- and shared/, backups/ when it has some. | |
| handle | resolved lazily -- never part of the entity's data. | |
| handleServer | ||
| healthExpect | text the answer to $healthPath must contain for the release to count as live (null: any 2xx). | |
| healthFile | a relative path that MUST exist in a shipped release for it to be considered valid. | |
| healthOrigin | the host header / origin the post-activation health check uses when probing the target from inside (null: derived from $url). | |
| healthPath | the path the post-activation health check requests, on the host of $url (e.g. | |
| healthTimeout | how long the post-activation health check keeps asking before giving up, in seconds (null: the value | |
| keep | how many releases to keep on the target (PruneTask). | |
| name | the target's identifier, e.g. | |
| probe | where the post-activation http probe runs from: one of PROBES (null: target, or local when the server is Server::$managed). | |
| project | the Project this target deploys (null: the single implicit project). | |
| publicPath | the release-relative folder the web server serves -- the release's document root. | |
| ref | the git ref a release for this target is built from. | |
| reload | command run on the target right after the symlink swap (e.g. | |
| server | the Server this target lives on. | |
| shared | paths (relative to a release) that must NOT be part of a release: they live in shared/ and are symlinked into every release, so they survive a deploy and a rollback untouched. | |
| shell | a legacy/explicit iShell configuration path (local, #ssh), used when $server is not set. | |
| tags | free-form labels, used by --tags= selection (e.g. | |
| url | the public url, used by the post-activation health check. | |
| vars | extra {placeholders} available to every templated property of this target. | |
| webRoot | the path, fixed by the host, that must resolve to the live release's document root. | |
| absolute($path, $what) | ||
| assertRequired() | Refuse a target that does not say what it needs: nothing is inherited, so each one writes its own ref and folder -- and a folder that is relative has a server root to start from. | |
| assertVars() | Refuse a name or a vars value that a shell would find interesting. | |
| assertWebRoot() | Refuse a $webRoot that would make install do something irreversible or circular. | |
| debugName() | ||
| getAddress() | ||
| getBackupFolder() | ||
| getCurrentLink() | ||
| getDatabase() | ||
| getDeclaredFolder() | ||
| getFolder() | ||
| getHealthExpect() | ||
| getHealthFile() | ||
| getHealthOrigin() | ||
| getHealthPath() | ||
| getHealthTimeout() | ||
| getHealthUrl() | ||
| getJournalFilename() | ||
| getKeep() | ||
| getLayoutFolders() | The folders that must exist on the target before anything can be shipped to it: shared/ only for a target that declares shared paths, backups/ only for one with a database. | |
| getLockFolder() | ||
| getName() | ||
| getProbe() | ||
| getProjectName() | ||
| getPublicFolder($release) | ||
| getPublicLink() | ||
| getPublicPath() | ||
| getRef() | ||
| getReleaseFolder($release) | ||
| getReleasesFolder() | ||
| getReload() | ||
| getServer() | ||
| getServerName() | ||
| getSharedFolder() | ||
| getSharedPaths() | ||
| getShell() | The shell used to reach this target. | |
| getShellPath() | ||
| getStateFolder() | ||
| getTags() | ||
| getUrl() | ||
| getWebRoot() | ||
| hasAnyTag($tags) | ||
| hasTag($tag) | ||
| isEnabled() | ||
| isLocal() | ||
| isManaged() | ||
| isWebRootInFolder() | ||
| resolve($text) | Replace {name} and every $vars key in $text. | |
| resolveTemplate($text) | Resolve a template install writes on the target, or the command it runs: resolve, plus what only a whole target knows -- so that one vhost template serves every target, whatever each one dec… | |
| setServer($server) | ||
| setShell($shell) | Force the shell (used by tests, and by a controller that already holds a connected shell). |
Constants7
DEFAULT_WEB_ROOT
what a managed server's target serves when it says nothing: a folder of its own folder. $webRoot
NO_WEB_ROOT
what a target writes as its webRoot to have none, managed server or not.
PROBES
PROBE_LOCAL
it runs on the DEPLOYING machine, against the public url only -- the only thing a webspace can prove.
PROBE_NONE
it does not run: the release is considered good once current points at it.
PROBE_TARGET
the post-activation http probe runs on the target itself, against 127.0.0.1 and against the url.
SAFE
what a target name, and any vars value, is allowed to contain. assertVars
Properties24
database
the database name on the target (null: this target has no database).
enabled
false to keep the target declared but excluded from every TAG-based fan-out (Targets::select).
- Type
- bool
folder
the target's own folder, holding releases/, current, deploy/ -- and shared/, backups/ when it has some. Required. Absolute, or relative to its server's Server::$root -- acme on a server rooted at /var/www is /var/www/acme.
handle
resolved lazily -- never part of the entity's data.
handleServer
healthExpect
text the answer to $healthPath must contain for the release to count as live (null: any 2xx).
healthFile
a relative path that MUST exist in a shipped release for it to be considered valid.
healthOrigin
the host header / origin the post-activation health check uses when probing the target from inside (null: derived from $url). ActivateTask::checkHealth
healthPath
the path the post-activation health check requests, on the host of $url (e.g. /health). Redirects are followed, and only a final 2xx counts. ActivateTask::checkHealth
- Type
- string
healthTimeout
how long the post-activation health check keeps asking before giving up, in seconds (null: the value
- See
ActivateTaskwas constructed with; 0 disables the http check entirely).
keep
how many releases to keep on the target (PruneTask).
- Type
- int
name
the target's identifier, e.g. 'demo'.
- Type
- string
probe
where the post-activation http probe runs from: one of PROBES (null: target, or local when the server is Server::$managed).
project
the Project this target deploys (null: the single implicit project).
publicPath
the release-relative folder the web server serves -- the release's document root.
- Type
- string
ref
the git ref a release for this target is built from. Required: nothing picks one for a target.
reload
command run on the target right after the symlink swap (e.g. a php-fpm reload + opcache reset).
server
the Server this target lives on.
shared
paths (relative to a release) that must NOT be part of a release: they live in shared/ and are symlinked into every release, so they survive a deploy and a rollback untouched.
- Type
- array
shell
a legacy/explicit iShell configuration path (local, #ssh), used when $server is not set.
tags
free-form labels, used by --tags= selection (e.g. 'prod', 'staging').
- Type
- array
url
the public url, used by the post-activation health check.
vars
extra {placeholders} available to every templated property of this target. assertVars NOTE the explicit object schema is required: a plain #[ArrayProperty()] on an array property coerces to a LIST, so a map like {"domain": "x.com"} fails to coerce and is dropped -- silently, into
- Type
- array
- See
aEntity::getErrors, which nothing reads.Store::assertRownow reads it.
webRoot
the path, fixed by the host, that must resolve to the live release's document root. Absolute, or relative to the server's Server::$root; {folder} stands for the target's folder.
Methods51
absolute($path, $what)
Target.php:360assertRequired()
Target.php:265Refuse a target that does not say what it needs: nothing is inherited, so each one writes its own ref and folder -- and a folder that is relative has a server root to start from.
| returns | void | |
| throws |
assertVars()
Target.php:231Refuse a name or a vars value that a shell would find interesting.
| returns | void | |
| throws |
assertWebRoot()
Target.php:294Refuse a $webRoot that would make install do something irreversible or circular.
| returns | void | |
| throws |
debugName()
Target.php:218| returns | string |
getAddress()
Target.php:494| returns | string | how a human should read where this target lives. |
getBackupFolder()
Target.php:471| returns | string |
getCurrentLink()
Target.php:452| returns | string |
getDatabase()
Target.php:371getDeclaredFolder()
Target.php:352getFolder()
Target.php:347| returns | string | the target's folder, absolute: as written, or under its server's root. |
| throws | when it is relative and its server has no root to start from. |
getHealthExpect()
Target.php:426| returns | null | string | $healthExpect, its target placeholders resolved -- the release ones are the caller's. |
getHealthFile()
Target.php:374getHealthOrigin()
Target.php:437getHealthPath()
Target.php:423| returns | string |
getHealthTimeout()
Target.php:375getHealthUrl()
Target.php:429| returns | null | string | the url the health check requests: $url's scheme, host and port, with $healthPath. |
getJournalFilename()
Target.php:470| returns | string |
getKeep()
Target.php:376| returns | int |
getLayoutFolders()
Target.php:478The folders that must exist on the target before anything can be shipped to it: shared/ only for a target that declares shared paths, backups/ only for one with a database.
| returns | array |
getLockFolder()
Target.php:469| returns | string |
getName()
Target.php:334| returns | string |
getProbe()
Target.php:418| returns | string | where the post-activation http probe runs from, one of PROBES. A managed webspace defaults to local because its loopback is not this site (Server::$managed). |
getProjectName()
Target.php:340getPublicFolder($release)
Target.php:462getPublicLink()
Target.php:456| returns | string | the path the web server must serve: the document root OF whatever current points at. |
getPublicPath()
Target.php:380| returns | string | the release-relative document root, with no leading or trailing slash ('' means the release root). |
getRef()
Target.php:341| returns | string |
getReleaseFolder($release)
Target.php:453getReleasesFolder()
Target.php:450| returns | string |
getReload()
Target.php:373getServer()
Target.php:490getServerName()
Target.php:339getSharedFolder()
Target.php:451| returns | string |
getSharedPaths()
Target.php:444| returns | array | the release-relative paths kept in shared/, placeholders resolved. |
getShell()
Target.php:513The shell used to reach this target.
| returns | iShell | |
| throws | if nothing usable is configured. |
getShellPath()
Target.php:377getStateFolder()
Target.php:468| returns | string | the folder of mmo.admin's own state on the target: nothing of the site, nothing served. |
getTags()
Target.php:336| returns | array |
getUrl()
Target.php:372getWebRoot()
Target.php:383hasAnyTag($tags)
Target.php:338hasTag($tag)
Target.php:337isEnabled()
Target.php:335| returns | bool |
isLocal()
Target.php:503isManaged()
Target.php:412| returns | bool | whether this target's web server belongs to the host. Server::$managed |
isWebRootInFolder()
Target.php:315resolve($text)
Target.php:325Replace {name} and every $vars key in $text.
resolveTemplate($text)
Target.php:400Resolve a template install writes on the target, or the command it runs: resolve, plus what only a whole target knows -- so that one vhost template serves every target, whatever each one declares.
setServer($server)
Target.php:491setShell($shell)
Target.php:530Force the shell (used by tests, and by a controller that already holds a connected shell).
Inherited members (110)
| Constants | Declared by | Description | |
|---|---|---|---|
FLAG_CHANGED | iEntity | ||
FLAG_CREATED | iEntity | ||
FLAG_IGNORE_CHANGE | iEntity | ||
FLAG_IGNORE_ENTITY | iEntity | ||
FLAG_OPACIFY | iEntity | ||
FLAG_REMOVED | iEntity |
| Properties | Declared by | Description | |
|---|---|---|---|
ArrayProperties | aEntity | ||
changes | aEntity | ||
collection | Entity | ||
ctime | Entity | ||
errors | aEntity | ||
flags | aEntity | ||
id | Entity | identifier in collection | |
label | Entity | short name | |
links | aEntity | ||
mtime | Entity | ||
SearchProperties | aEntity | ||
status | aEntity | ||
title | Entity | long name |
| Methods | Declared by | Description | |
|---|---|---|---|
addFlags($flags) | aEntity | ||
addLink($link) | aEntity | Append a link. | |
archive() | aEntity | This function is called to 'delete' the entity. | |
ArrayProperties() | aEntity | Build (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) | aEntity | Check data before it touches any entity: would an entity made from $data be valid? | |
clearChanges() | aEntity | Reset change tracking: clears iEntity::FLAG_CHANGED and forgets every recorded change. | |
compareTo($value) | aEntity | Compare value | |
conversionError($key, $e) | aEntity | The 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) | Entity | Build 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) | aEntity | Read a (possibly nested) value by json-path, e.g. | |
getArrayProperty($key, $isRef, $store) | aEntity | Read 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) | aEntity | Get 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) | aEntity | The 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() | Entity | Ignore everything about this entity: discard its pending changes and flag it so it's skipped by future commits (aRepository::onCommit). | |
ignoreChanges($value) | aEntity | Temporarily suppress markChanged (used e.g. | |
isActive() | aEntity | ||
isArchive() | aEntity | ||
isArrayPropertySet($key, $store) | Entity | Same 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() | aEntity | Tells if an entity has enough information to be unique (at least one unique group has no null) | |
isValid() | aEntity | ||
isValidated() | aEntity | ||
ListClassReferences($onlyStorable) | aEntity | Get a list of all the classes and their properties that are using references to this class. | |
loadArray($data, $coerceOptions, $fromStore) | Entity | Same 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) | Entity | Restore from stored data, setting 'ctime'/'mtime' directly (bypassing their normal setters -- see setCtime/setMtime, which are read-only via #[ArrayProperty]). | |
localName() | Entity | ||
loopReferences() | Entity | Yield all the entities in the repository that have a reference on this one. | |
markChanged($keys) | Entity | Same 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) | aEntity | Hide 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) | aEntity | Append a value to a (possibly nested) list property by json-path. | |
reload() | Entity | Reload entity from its repository | |
removeFlags($flags) | aEntity | ||
removeLink($link) | aEntity | Remove a link (by identity). | |
removePermanently($force) | Entity | Remove entity from database | |
replaceBy($replace, $mergeData) | Entity | Replace this entity by another one, trying to change all references to this entity to the new one. | |
Schema() | aEntity | The JSON-Schema describing every #[ArrayProperty] of this class (built once and cached by ArrayProperties). | |
SearchProperty($name) | aEntity | ||
set($path, $value) | aEntity | Write a (possibly nested) value by json-path, creating intermediate structure as needed. | |
setArrayProperty($key, $value, $coerceOptions, $ignoreReadonly) | aEntity | Same 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) | aEntity | Same 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) | Entity | Move this entity to (or out of, if null) a collection. | |
setCtime($date, $force) | Entity | Set creation time | |
setId($id) | Entity | Set the id, re-registering this entity in its $collection under the new id (Collection's entities are keyed by id). | |
setLinks($links) | aEntity | Replace every link with $links. | |
setMtime($date, $force) | Entity | Set modification time | |
setStatus($status) | aEntity | ||
store() | aEntity | Export all array properties with store set to true. | |
test($filter) | aEntity | ||
toArray($fields, $flatten, $recursive) | aEntity | Same 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) | aEntity | Set array property | |
traitSetArrayPropertyOffset($key, $offset, $value, $coerceOptions) | aEntity | Set/push a value into an array property | |
traitToArray($fields, $flatten, $recursive) | aEntity | Export fields to an array. | |
uid() | Entity | ||
validate($errors) | aEntity | Validate 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 |