MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

ReleaseScriptsTask

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

class

ReleaseScriptsTask

ReleaseScriptsTask.php:31

Run the release scripts a target has not run yet, once the new release is live: what a version needs done on each site besides its code and its database patches -- roles to create (php admin.php developer roles), files to move, a cache to rebuild, an index to fill.

class MMO\admin\tasks\ReleaseScriptsTask extends MMO\admin\classes\aDeployTask
Namespace
MMO\admin\tasks
Extends
aDeployTask
A script is a file of [`$folder`](https://mmoframework.fr/en/documentation/mmo.admin/php/tasks/ReleaseScriptsTask.md#releasescriptstask-folder) (`scripts/release/` by default, on the deploying machine: the folder never ships), its id its filename. It runs **once per target**, as the database patches do: the journal records it (`Deployment::$scripts`, [`Journal::getRanScripts`](https://mmoframework.fr/en/documentation/mmo.admin/php/helpers/Journal.md#journal-getranscripts)), and a target that has run it never runs it again -- a new target runs them all, so a script must be idempotent (« create the role when it is missing »). They run in natural order of their names: prefix them with the version or the date (`4.3.0-01-developer-roles.sh`, `2026-10-13-01-developer-roles.sh`). - `.php` runs with `php`, `.sh` with `bash`; it is sent into the live release (`current/.release-scripts/`), run from the release's folder, then removed. It is given `MMO_TARGET`, `MMO_RELEASE`, `MMO_VERSION` and `MMO_URL`. - A script that fails stops the ones after it (they may assume it ran) and **fails the release**: the release is rolled back -- the previous code, the database snapshot -- and the script stays to run. Unless its name says `.optional.` (`4.3.0-02-reindex.optional.php`): its failure is then said, the release stays, the scripts after it run (nothing may count on an optional one), and it runs again at the next release (or `php scripts/admin.php release-scripts --targets=...`). It runs after [`ActivateTask`](https://mmoframework.fr/en/documentation/mmo.admin/php/tasks/ActivateTask.md#activatetask): a script runs against the code it is written for, and the site answers already.

Constants1

OPTIONAL

what makes a script's failure a warning rather than the release's failure

const OPTIONAL = '.optional.'

Properties2

folder

protected string $folder
Type
string

pattern

protected string $pattern
Type
string

Methods9

getPending($context, $excludeRan)

ReleaseScriptsTask.php:120
function getPending(MMO\admin\helpers\Context $context, bool $excludeRan = true): array
$contextContext
$excludeRan = trueboolleave out the scripts the journal says ran
returnsarraystring> id => filename, in natural order

__construct($folder, $pattern)

ReleaseScriptsTask.php:35
function __construct( string $folder = '{root}/scripts/release', string $pattern = '/\\.(php|sh)$/' )
$folder = '{root}/scripts/release'string
$pattern = '/\\.(php|sh)$/'string
Inherited members (37)
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.
getVerbosity()aDeployTask
info($message, $context)aDeployTaskInteresting events. No-op if INFO is currently filtered out by the verbosity mask.
isChange()aDeployTaskWhether running this task CHANGES anything.
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.
warning($message, $context)aDeployTaskExceptional occurrences that are not errors.