Index

RestoreTask

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

class

RestoreTask

RestoreTask.php:17

Replace the target's database with the content of a dump.

class MMO\admin\tasks\RestoreTask extends MMO\admin\classes\aDatabaseTask
Namespace
MMO\admin\tasks
Extends
aDatabaseTask
The single most destructive operation in the whole package, so it is the one with the most guardrails: - it always takes a snapshot of what it is about to overwrite FIRST ([`aDatabaseTask::snapshot`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/classes/aDatabaseTask.md#adatabasetask-snapshot)), and puts that snapshot in the journal, so "restore the wrong file" is recoverable rather than terminal; - it never picks a file for you: `--file=` is required, and a local file is uploaded to the target's own backup folder before being restored, so the restore always reads from the target's disk.

Methods6

resolveFile($context)

RestoreTask.php:68
protected function resolveFile(MMO\admin\helpers\Context $context): string
$contextContext
returnsstring
throwswhen no dump was named.

rollback($context)

RestoreTask.php:54

Put back the snapshot taken before the restore.

function rollback(MMO\admin\helpers\Context $context): void
$contextContext
returnsvoid
Inherited members (43)
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
REQUIREDaDatabaseTask
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.
getDatabase($context)aDatabaseTask
getName()aDeployTask
getRepository($context)aDatabaseTask
getShell($context)aDatabaseTask
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.
isNeeded($context)aDeployTaskWhether this task has anything to do for this target -- e.g.
log($level, $message, $context)aDeployTaskLogs with an arbitrary level.
notice($message, $context)aDeployTaskNormal but significant events.
setVerbosity($verb)aDeployTaskSet the current verbosity mask, replacing whatever it was before.
snapshot($context)aDatabaseTaskTake a snapshot of the target's database and record it on the context, so whatever comes next is reversible.
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.