ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStyleConfigStoredObjective Class Reference
+ Inheritance diagram for ilStyleConfigStoredObjective:
+ Collaboration diagram for ilStyleConfigStoredObjective:

Public Member Functions

 __construct (\ilStyleSetupConfig $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Attributes

 $config
 

Detailed Description

Definition at line 8 of file class.ilStyleConfigStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilStyleConfigStoredObjective::__construct ( \ilStyleSetupConfig  $config)

Definition at line 15 of file class.ilStyleConfigStoredObjective.php.

References $config.

17  {
18  $this->config = $config;
19  }

Member Function Documentation

◆ achieve()

ilStyleConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 43 of file class.ilStyleConfigStoredObjective.php.

References $ini.

43  : Setup\Environment
44  {
45  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
46 
47  $ini->setVariable("tools", "lessc", $this->config->getPathToLessc());
48  $ini->setVariable("tools", "enable_system_styles_management", $this->config->getManageSystemStyles() ? "1" : "0");
49 
50  if (!$ini->write()) {
51  throw new Setup\UnachievableException("Could not write ilias.ini.php");
52  }
53 
54  return $environment;
55  }
$ini
Definition: raiseError.php:4

◆ getHash()

ilStyleConfigStoredObjective::getHash ( )

Definition at line 21 of file class.ilStyleConfigStoredObjective.php.

21  : string
22  {
23  return hash("sha256", self::class);
24  }

◆ getLabel()

ilStyleConfigStoredObjective::getLabel ( )

Definition at line 26 of file class.ilStyleConfigStoredObjective.php.

26  : string
27  {
28  return "Fill ini with settings for Services/Style";
29  }

◆ getPreconditions()

ilStyleConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 36 of file class.ilStyleConfigStoredObjective.php.

36  : array
37  {
38  return [
40  ];
41  }

◆ isApplicable()

ilStyleConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 60 of file class.ilStyleConfigStoredObjective.php.

References $ini.

60  : bool
61  {
62  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
63  $manage_system_styles = $this->config->getManageSystemStyles() ? "1" : "0";
64 
65  return
66  $ini->readVariable("tools", "lessc") !== $this->config->getPathToLessc() ||
67  $ini->readVariable("tools", "enable_system_styles_management") !== $manage_system_styles
68  ;
69  }
$ini
Definition: raiseError.php:4

◆ isNotable()

ilStyleConfigStoredObjective::isNotable ( )

Definition at line 31 of file class.ilStyleConfigStoredObjective.php.

31  : bool
32  {
33  return false;
34  }

Field Documentation

◆ $config

ilStyleConfigStoredObjective::$config
protected

Definition at line 13 of file class.ilStyleConfigStoredObjective.php.

Referenced by __construct().


The documentation for this class was generated from the following file: