ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilVirusScannerSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 use ILIAS\Refinery;
23 use ILIAS\Setup;
24 
26 {
28 
29  protected Factory $refinery;
30 
31  public function __construct(
32  Factory $refinery
33  ) {
34  $this->refinery = $refinery;
35  }
36 
37  public function hasConfig(): bool
38  {
39  return true;
40  }
41 
43  {
44  return $this->refinery->custom()->transformation(fn($data): ilVirusScannerSetupConfig => new ilVirusScannerSetupConfig(
46  $data['path_to_scan'] ?? null,
47  $data['path_to_clean'] ?? null,
48  $data['icap_host'] ?? null,
49  $data['icap_port'] ?? null,
50  $data['icap_service_name'] ?? null,
51  $data['icap_client_path'] ?? null,
52  ));
53  }
54 
55  public function getInstallObjective(?Setup\Config $config = null): Setup\Objective
56  {
57  return new ilVirusScannerConfigStoredObjective($config);
58  }
59 
60  public function getUpdateObjective(?Setup\Config $config = null): Setup\Objective
61  {
62  if ($config !== null) {
63  return new ilVirusScannerConfigStoredObjective($config);
64  }
65 
66  return new Setup\Objective\NullObjective();
67  }
68 
69  public function getBuildObjective(): Setup\Objective
70  {
71  return new Setup\Objective\NullObjective();
72  }
73 
74  public function getStatusObjective(?Setup\Metrics\Storage $storage): Setup\Objective
75  {
76  return new ilVirusScannerMetricsCollectedObjective($storage);
77  }
78 
79  public function getMigrations(): array
80  {
81  return [];
82  }
83 }
getStatusObjective(?Setup\Metrics\Storage $storage)
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
getMigrations()
Get a named map of migrations available for this Agent.
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Storage is simple key/value store without further schema definition.
Definition: Storage.php:29
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
hasConfig()
Does this agent require a configuration?
getUpdateObjective(?Setup\Config $config=null)
Builds data types.
Definition: Factory.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.
getInstallObjective(?Setup\Config $config=null)
A configuration for the setup.
Definition: Config.php:26