ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilAuthenticationSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 use ILIAS\Setup;
23 use ILIAS\Refinery;
24 
26 {
28 
29  protected const DEFAULT_SESSION_EXPIRE_IN_SECONDS = 1_800;
30 
31  public function __construct(protected Refinery\Factory $refinery)
32  {
33  }
34 
35  public function hasConfig(): bool
36  {
37  return true;
38  }
39 
41  {
42  return $this->refinery->custom()->transformation(function ($data): \ilAuthenticationSetupConfig {
43  return new ilAuthenticationSetupConfig($data["session_max_idle"] ?? self::DEFAULT_SESSION_EXPIRE_IN_SECONDS);
44  });
45  }
46 
47  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
48  {
49  if ($config !== null) {
50  return new ilSessionMaxIdleIsSetObjective($config);
51  }
52 
54  new ilAuthenticationSetupConfig(self::DEFAULT_SESSION_EXPIRE_IN_SECONDS)
55  );
56  }
57 
58  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
59  {
60  if ($config !== null) {
61  return new Setup\ObjectiveCollection(
62  'Authentication',
63  true,
66  ),
69  ),
70  new ilSessionMaxIdleIsSetObjective($config),
73  )
74  );
75  }
76 
77  return new Setup\ObjectiveCollection(
78  'Authentication',
79  true,
82  ),
85  ),
88  )
89  );
90  }
91 
92  public function getBuildObjective(): Setup\Objective
93  {
94  return new Setup\Objective\NullObjective();
95  }
96 
97  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
98  {
99  return new Setup\ObjectiveCollection(
100  'Component Authentication',
101  true,
103  $storage,
105  ),
107  $storage,
109  ),
110  );
111  }
112 
113  public function getMigrations(): array
114  {
115  return [];
116  }
117 }
hasConfig()
Does this agent require a configuration?
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
getInstallObjective(Setup\Config $config=null)
getUpdateObjective(Setup\Config $config=null)
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
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.
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
getStatusObjective(Setup\Metrics\Storage $storage)
A configuration for the setup.
Definition: Config.php:26
__construct(protected Refinery\Factory $refinery)
getMigrations()
Get a named map of migrations available for this Agent.