30 protected function achieveObjective(
32 Environment $environment,
35 $iterator = new ObjectiveIterator($environment, $objective);
38 register_shutdown_function(
static function () use (&$current) {
39 if (
null !== $current) {
40 throw new \RuntimeException(
"Objective '{$current->getLabel()}' failed because it halted the program.");
44 while ($iterator->valid()) {
45 $current = $iterator->current();
46 if (!$current->isApplicable($environment)) {
53 $io->startObjective($current->getLabel(), $current->isNotable());
56 $environment = $current->achieve($environment);
58 $io->finishedLastObjective();
60 $iterator->setEnvironment($environment);
61 }
catch (NotExecutableException
$e) {
63 }
catch (\Throwable
$e) {
64 $iterator->markAsFailed($current);
67 $io->failedLastObjective();
68 if ($io->isVerbose()) {
An exception for terminatinating execution or to throw for unit testing.
Signals that the setup is not executable at all.
Tries to enumerate all preconditions for the given objective, where the ones that can be achieved (i....
An environment holds resources to be used in the setup process.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...