ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilVirusScannerMetricsCollectedObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 use ILIAS\Setup;
22 
23 class ilVirusScannerMetricsCollectedObjective extends Setup\Metrics\CollectedObjective
24 {
28  protected function getTentativePreconditions(Setup\Environment $environment): array
29  {
30  return [
32  ];
33  }
34 
35  protected function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage): void
36  {
37  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
38  if (!$ini) {
39  return;
40  }
41 
42  $virus_scanner = $ini->readVariable('tools', 'vscantype');
43  $storage->storeConfigText(
44  'virusscanner',
45  $virus_scanner,
46  'The engine that is used for virus scanning.'
47  );
48 
49  if ($virus_scanner === ilVirusScannerSetupConfig::VIRUS_SCANNER_ICAP) {
50  $storage->storeConfigText(
51  'icap_client_path',
52  $ini->readVariable('tools', 'icap_client_path'),
53  'The configured ICAP client path.'
54  );
55  $storage->storeConfigText(
56  'icap_host',
57  $ini->readVariable('tools', 'icap_host'),
58  'The configured ICAP host.'
59  );
60  $storage->storeConfigText(
61  'icap_port',
62  $ini->readVariable('tools', 'icap_port'),
63  'The configured ICAP port.'
64  );
65  $storage->storeConfigText(
66  'icap_service_name',
67  $ini->readVariable('tools', 'icap_service_name'),
68  'The configured ICAP service name.'
69  );
70  } elseif (is_string($virus_scanner) &&
71  $virus_scanner !== '' &&
73  $storage->storeConfigText(
74  'path_to_scan',
75  $ini->readVariable('tools', 'scancommand'),
76  'The path to the binary that is used for virus scanning.'
77  );
78  $storage->storeConfigText(
79  'path_to_clean',
80  $ini->readVariable('tools', 'cleancommand'),
81  'The path to the binary that is used for cleaning up after virus scanning.'
82  );
83  }
84  }
85 }
collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage)
Storage is simple key/value store without further schema definition.
Definition: Storage.php:29
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
$ini
Definition: raiseError.php:20