ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilMathJaxMetricsCollectedObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 use ILIAS\Setup;
21 use ILIAS\Refinery;
22 
23 class ilMathJaxMetricsCollectedObjective extends Setup\Metrics\CollectedObjective
24 {
25  protected function getTentativePreconditions(Setup\Environment $environment): array
26  {
27  return [
28  new \ilSettingsFactoryExistsObjective()
29  ];
30  }
31 
32  protected function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage): void
33  {
35  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
36  $repo = new ilMathJaxConfigSettingsRepository($factory->settingsFor('MathJax'));
37  $config = $repo->getConfig();
38 
39  $setup_config = new ilMathJaxSetupConfig([]);
40  foreach ($setup_config->getDataFromConfig($config) as $key => $value) {
41  if (is_bool($value)) {
42  $storage->storeStableBool($key, $value);
43  } else {
44  $storage->storeStableText($key, (string) $value);
45  }
46  }
47  }
48 }
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:27
Repository for storing and loading the MathJax configuration.