ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilNotificationsSetupAgent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25use ILIAS\Setup\Agent\HasNoNamedObjective;
32
34{
35 use HasNoNamedObjective;
36
40 public function __construct(protected readonly Factory $refinery, protected readonly array $provider)
41 {
42 }
43
44 public function hasConfig(): bool
45 {
46 return true;
47 }
48
50 {
51 return $this->refinery->custom()->transformation(static function ($data): Config {
52 if ($data !== null) {
53 if (($data['private_key_path'] ?? '') === '') {
54 throw new InvalidArgumentException(
55 'No valid private key path given for push notifications. Please check your config file.'
56 );
57 }
58 return new PushNotificationConfig($data['private_key_path']);
59 } else {
60 return new NullConfig();
61 }
62 });
63 }
64
65 public function getInstallObjective(?Config $config = null): Objective
66 {
67 return new PushNotificationObjective($this->provider, $config ?? new NullConfig());
68 }
69
70 public function getUpdateObjective(?Config $config = null): Objective
71 {
72 return new ObjectiveCollection(
73 'Notification Objectives',
74 true,
75 new ilTreeAdminNodeAddedObjective('nota', 'Notification Service Administration Object'),
78 new PushNotificationObjective($this->provider, $config ?? new NullConfig())
79 );
80 }
81
82 public function getBuildObjective(): Objective
83 {
84 return new NullObjective();
85 }
86
87 public function getStatusObjective(Storage $storage): Objective
88 {
90 }
91
92 public function getMigrations(): array
93 {
94 return [];
95 }
96}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Builds data types.
Definition: Factory.php:36
A configuration with no content.
Definition: NullConfig.php:27
A objective collection is a objective that is achieved once all subobjectives are achieved.
A non-objective, nothing to do to achieve it...
This class attempt to achieve a set of database update steps.
hasConfig()
Does this agent require a configuration?
getUpdateObjective(?Config $config=null)
Get the goal the agent wants to achieve on update.
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
getInstallObjective(?Config $config=null)
Get the goals the agent wants to achieve on setup.
__construct(protected readonly Factory $refinery, protected readonly array $provider)
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.
A transformation is a function from one datatype to another.
A agent is some component that performs part of the setup process.
Definition: Agent.php:30
A configuration for the setup.
Definition: Config.php:27
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
$provider
Definition: ltitoken.php:80