19 declare(strict_types=1);
36 $this->steps = $steps ?? $migration->getDefaultAmountOfStepsPerRun();
45 return hash(
"sha256", self::class .
'' . get_class($this->migration));
53 return $this->migration->getLabel();
70 return $this->migration->getPreconditions($environment);
82 $key = (new \ReflectionClass($this->migration))->getShortName();
83 $confirmation = $io->confirmExplicit(
84 "Do you really want to run the following migration? Make sure you have a backup\n" .
85 "of all your data. You will run this migration on your own risk.\n\n" .
86 "Please type '$key' to confirm and start.",
90 $io->error(
"Migration '$key' aborted.");
93 $io->inform(
"Preparing Migration: This may take quite a long time (e.g. all files are collected.");
94 $this->migration->prepare($environment);
95 $io->inform(
"Preparing Migration: done.");
98 $remaining = $this->migration->getRemainingAmountOfSteps();
102 $io->inform(
"Trigger {$steps} step(s) in {$this->getLabel()}");
104 $io->startProgress($steps);
106 while ($step < $steps) {
107 $io->advanceProgress();
108 $this->migration->step($environment);
112 $remaining = $this->migration->getRemainingAmountOfSteps();
113 if ($remaining == 0) {
114 $io->inform(
"Migration '{$key}' has no remaining steps left.");
117 $io->inform(
"{$remaining} step(s) remaining. Run again to proceed.");
128 $this->migration->prepare($environment);
130 return $this->migration->getRemainingAmountOfSteps() > 0;
isNotable()
Defaults to 'true'.
isApplicable(Setup\Environment $environment)
An objective is a desired state of the system that is supposed to be created by the setup...
A migration is a potentially long lasting operation that can be broken into discrete steps...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Setup Migration $migration
__construct(Setup\Migration $migration, ?int $steps=null)
getHash()
Uses hashed Path.
getPreconditions(Setup\Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
achieve(Environment $environment)
Objectives can be achieved.
An environment holds resources to be used in the setup process.
const RESOURCE_ADMIN_INTERACTION