Index

AssertArtifactTask

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

class

AssertArtifactTask

AssertArtifactTask.php:26

Read the finished artifact back and refuse to ship it if it contains anything that must never leave a developer's machine.

class MMO\admin\tasks\AssertArtifactTask extends MMO\admin\classes\aDeployTask
Namespace
MMO\admin\tasks
Extends
aDeployTask
Three independent mechanisms keep dev-only files out of a release, and this is the last of them: 1. `export-ignore` in the project's `.gitattributes` -- honoured by `git archive` itself, on every branch and every machine, with no hook installed and no per-branch `.gitignore` to swap. This is the mechanism. 2. [`BuildTask::$exclude`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/tasks/BuildTask.md#buildtask-exclude) -- a deny-list applied to the exported tree, for paths git does not track. 3. **This task** -- which trusts neither of the above and simply looks inside the tarball. The third one exists because the first two are configuration, and configuration is what gets forgotten when a new file is added. A deployment that leaks `deploy.json` or a private key is not a deployment that can be rolled back: the secret is on the server, in an artifact, in a backup, and quite possibly served over HTTP. So the check is not "warn and continue" -- it fails the release before anything is uploaded. Patterns are matched against release-relative paths, `*` matching within one segment and `**` across them.

Index

FORBIDDENpaths that must never be inside a release.
allowed
forbidden
apply($context)Inspecting an archive changes nothing, so this runs during a dry run too -- a plan that cannot tell you the release would be refused is not worth printing.
getDescription()
getPatterns()
isChange()It only ever reads: a release where this was the only thing that ran deployed nothing.
isNeeded($context)Nothing to check until something has been built.
matches($path, $pattern)Glob matching where * stays inside one path segment and ** crosses them -- the same rule .gitignore and .gitattributes use, so a pattern that works there works here.
matchesAny($path, $patterns)
plan($context)
scan($context, $artifact)
__construct($forbidden, $allowed)

Constants1

FORBIDDEN

paths that must never be inside a release.

const FORBIDDEN = […23 items]

Properties2

allowed

protected array $allowed
Type
array

forbidden

protected array $forbidden
Type
array

Methods10

apply($context)

AssertArtifactTask.php:80

Inspecting an archive changes nothing, so this runs during a dry run too -- a plan that cannot tell you the release would be refused is not worth printing.

function apply(MMO\admin\helpers\Context $context): void
$contextContext
returnsvoid
throwswhen the artifact carries something it must not.

isChange()

AssertArtifactTask.php:67

It only ever reads: a release where this was the only thing that ran deployed nothing.

function isChange(): bool
returnsbool

matches($path, $pattern)

AssertArtifactTask.php:148

Glob matching where * stays inside one path segment and ** crosses them -- the same rule .gitignore and .gitattributes use, so a pattern that works there works here.

protected function matches(string $path, string $pattern): bool
$pathstring
$patternstring
returnsbool

scan($context, $artifact)

AssertArtifactTask.php:105
protected function scan(MMO\admin\helpers\Context $context, string $artifact): array
$contextContext
$artifactstring
returnsarraythe release-relative paths that must not be there.
Inherited members (38)
ConstantsDeclared byDescription
ALERTiLogLevelAlert: Action must be taken immediately.
ALLiLogLevelMask for all
ALL_PLUSiLogLeveldebug everything
BACKTRACEiLogLevel
CRITICALiLogLevelCritical: Critical conditions.
DEBUGiLogLevelDebug: Detailed debug information.
DEEPiLogLeveldebug everything with arguments
EMERGENCYiLogLevelEmergency: System is unusable.
ERRORiLogLevelError: Runtime errors that do not require immediate action but should typically be logged and monitored.
ERROR_PLUSiLogLevelMask for all error
FATALiLogLevelMask for all fatal error
INFOiLogLevelInfo: Interesting events.
INFO_PLUSiLogLevelMask for all errors/warning/notices/info
MEMORYiLogLevelinclude backtrace object
NOTICEiLogLevelNotice: Normal but significant events.
NOTICE_PLUSiLogLevelMask for all errors/warning/notices/info
TRACEiLogLevelinclude backtrace as origins
WARNINGiLogLevelWarning: Exceptional occurrences that are not errors.
WARNING_PLUSiLogLevelMask for all errors and warnings
PropertiesDeclared byDescription
verbosityaDeployTask
MethodsDeclared byDescription
alert($message, $context)aDeployTaskAction must be taken immediately.
backtraces($message, $context)aDeployTaskForce-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it).
critical($message, $context)aDeployTaskCritical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask.
debug($message, $context)aDeployTaskDetailed debug information.
debugName()aDeployTask
emergency($message, $context)aDeployTaskSystem is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask.
error($message, $context)aDeployTaskRuntime errors that do not require immediate action but should typically be logged and monitored.
getName()aDeployTask
getVerbosity()aDeployTask
info($message, $context)aDeployTaskInteresting events. No-op if INFO is currently filtered out by the verbosity mask.
isRollbackCritical()aDeployTask
log($level, $message, $context)aDeployTaskLogs with an arbitrary level.
notice($message, $context)aDeployTaskNormal but significant events.
rollback($context)aDeployTaskUndo this task. Called by the runner, in reverse order, for every task already applied when a later one failed.
setVerbosity($verb)aDeployTaskSet the current verbosity mask, replacing whatever it was before.
testVerbosity($level)aDeployTaskTest whether a given level (or set of levels) is currently enabled by this instance's verbosity mask.
verify($context)aDeployTaskCheck, by looking at the target, that the task really took effect.
warning($message, $context)aDeployTaskExceptional occurrences that are not errors.