ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
Definition: ByTrying.php:21
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
string $key
Consumer key/client ID value.
Definition: System.php:193
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
$factory
Definition: metadata.php:75
Repository for storing and loading the MathJax configuration.