ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLanguageSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 use ILIAS\Setup;
23 use ILIAS\Refinery;
24 use ILIAS\UI;
25 
26 class ilLanguageSetupAgent implements Setup\Agent
27 {
29 
30  protected Refinery\Factory $refinery;
31  protected \ilSetupLanguage $il_setup_language;
32 
33  public function __construct(
34  Refinery\Factory $refinery,
35  $_, // this is Data\Factory, but we do not need it...
36  \ilSetupLanguage $il_setup_language
37  ) {
38  $this->refinery = $refinery;
39  $this->il_setup_language = $il_setup_language;
40  }
41 
45  public function hasConfig(): bool
46  {
47  return false;
48  }
49 
54  {
55  throw new LogicException(self::class . " has no Config.");
56  }
57 
61  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
62  {
63  return new Setup\ObjectiveCollection(
64  "Complete objectives from Services/Language",
65  false,
66  new ilLanguagesInstalledAndUpdatedObjective($this->il_setup_language),
68  );
69  }
70 
74  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
75  {
76  return new Setup\ObjectiveCollection(
77  "Complete objectives from Services/Language",
78  false,
79  new ilLanguagesInstalledAndUpdatedObjective($this->il_setup_language),
80  );
81  }
82 
86  public function getBuildArtifactObjective(): Setup\Objective
87  {
88  return new Setup\Objective\NullObjective();
89  }
90 
94  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
95  {
96  return new ilLanguageMetricsCollectedObjective($storage, $this->il_setup_language);
97  }
98 
102  public function getMigrations(): array
103  {
104  return [];
105  }
106 }
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)
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Refinery\Factory $refinery, $_, \ilSetupLanguage $il_setup_language)
A transformation is a function from one datatype to another.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getStatusObjective(Setup\Metrics\Storage $storage)
A configuration for the setup.
Definition: Config.php:26
getUpdateObjective(Setup\Config $config=null)