ILIAS  release_8 Revision v8.24
class.ilMathJaxConfigStoredObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20use ILIAS\Setup;
21
23{
24 protected \ilMathJaxSetupConfig $config;
25
27 {
28 $this->config = $config;
29 }
30
31 public function getHash(): string
32 {
33 return hash("sha256", self::class);
34 }
35
36 public function getLabel(): string
37 {
38 return "Store configuration of Services/MathJax";
39 }
40
41 public function isNotable(): bool
42 {
43 return true;
44 }
45
46 public function getPreconditions(Setup\Environment $environment): array
47 {
48 return [
49 new \ilSettingsFactoryExistsObjective()
50 ];
51 }
52
53 public function achieve(Setup\Environment $environment): Setup\Environment
54 {
56 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
57 $repo = new ilMathJaxConfigSettingsRepository($factory->settingsFor('MathJax'));
58 $repo->updateConfig($this->config->applyTo($repo->getConfig()));
59
60 return $environment;
61 }
62
63 public function isApplicable(Setup\Environment $environment): bool
64 {
66 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
67 $repo = new ilMathJaxConfigSettingsRepository($factory->settingsFor('MathJax'));
68
69 return $this->config->isApplicableTo($repo->getConfig());
70 }
71}
Repository for storing and loading the MathJax configuration.
getPreconditions(Setup\Environment $environment)
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
$factory
Definition: metadata.php:75
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...