ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilStaticComponentRepositoryExistsObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Setup;
22
24{
28 public function getHash(): string
29 {
30 return hash("sha256", self::class);
31 }
32
36 public function getLabel(): string
37 {
38 return "ilComponentRepository (static) is initialized and stored into the environment.";
39 }
40
44 public function isNotable(): bool
45 {
46 return true;
47 }
48
52 public function getPreconditions(Setup\Environment $environment): array
53 {
54 return [
57 ];
58 }
59
63 public function achieve(Setup\Environment $environment): Setup\Environment
64 {
65 $data_factory = new ILIAS\Data\Factory();
66 $component_repository = new ilArtifactComponentRepository(
67 $data_factory,
69 $data_factory->version(ILIAS_VERSION_NUMERIC)
70 );
71
72 return $environment->withResource(
73 Setup\Environment::RESOURCE_COMPONENT_REPOSITORY,
74 $component_repository
75 );
76 }
77
81 public function isApplicable(Setup\Environment $environment): bool
82 {
83 return is_null($environment->getResource(Setup\Environment::RESOURCE_COMPONENT_REPOSITORY));
84 }
85}
Builds data types.
Definition: Factory.php:36
Repository for component data implemented over artifacts.
Repository interface for plugin state data.
const ILIAS_VERSION_NUMERIC
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
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...