ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilStyleConfigStoredObjective.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\Setup;
20
22{
26 protected $config;
27
28 public function __construct(
30 ) {
31 $this->config = $config;
32 }
33
34 public function getHash(): string
35 {
36 return hash("sha256", self::class);
37 }
38
39 public function getLabel(): string
40 {
41 return "Fill ini with settings for Services/Style";
42 }
43
44 public function isNotable(): bool
45 {
46 return false;
47 }
48
49 public function getPreconditions(Setup\Environment $environment): array
50 {
51 return [
53 ];
54 }
55
56 public function achieve(Setup\Environment $environment): Setup\Environment
57 {
58 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
59
60 $ini->setVariable(
61 "tools",
62 "scss",
63 $this->config->getPathToScss() ?? ''
64 );
65 $ini->setVariable("tools", "enable_system_styles_management", $this->config->getManageSystemStyles() ? "1" : "0");
66
67 if (!$ini->write()) {
68 throw new Setup\UnachievableException("Could not write ilias.ini.php");
69 }
70
71 return $environment;
72 }
73
77 public function isApplicable(Setup\Environment $environment): bool
78 {
79 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
80 $manage_system_styles = $this->config->getManageSystemStyles() ? "1" : "0";
81
82 return
83 $ini->readVariable("tools", "lessc") !== $this->config->getPathToScss() ||
84 $ini->readVariable("tools", "enable_system_styles_management") !== $manage_system_styles
85 ;
86 }
87}
Signals that some goal won't be achievable by actions of the system ever.
getPreconditions(Setup\Environment $environment)
isApplicable(Setup\Environment $environment)
@inheritDoc
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...
$ini
Definition: raiseError.php:20