ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
class.ilDBStepExecutionDBExistsObjective.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\Setup;
20use ILIAS\DI;
21
23{
24 public function getHash(): string
25 {
26 return hash("sha256", self::class);
27 }
28
29 public function getLabel(): string
30 {
31 return "The execution log for database update steps exists.";
32 }
33
34 public function isNotable(): bool
35 {
36 return true;
37 }
38
39 public function getPreconditions(Setup\Environment $environment): array
40 {
41 return [
42 new \ilDatabaseUpdatedObjective()
43 ];
44 }
45
46 public function achieve(Setup\Environment $environment): Setup\Environment
47 {
48 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
49 return $environment
50 ->withResource(
51 \ilDBStepExecutionDB::class,
53 $db,
54 fn () => new \DateTime()
55 )
56 );
57 }
58
62 public function isApplicable(Setup\Environment $environment): bool
63 {
64 $execution_db = $environment->getResource(\ilDBStepExecutionDB::class);
65 return is_null($execution_db);
66 }
67}
isApplicable(Setup\Environment $environment)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Container.php:19
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...