ILIAS  release_8 Revision v8.24
ilPluginLanguageUpdatedObjective Class Reference
+ Inheritance diagram for ilPluginLanguageUpdatedObjective:
+ Collaboration diagram for ilPluginLanguageUpdatedObjective:

Public Member Functions

 __construct (string $plugin_name)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 

Protected Member Functions

 initEnvironment (Setup\Environment $environment, \ilComponentRepository $component_repository)
 

Protected Attributes

string $plugin_name
 

Detailed Description

Definition at line 24 of file class.ilPluginLanguageUpdatedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginLanguageUpdatedObjective::__construct ( string  $plugin_name)

Definition at line 28 of file class.ilPluginLanguageUpdatedObjective.php.

29 {
30 $this->plugin_name = $plugin_name;
31 }

References $plugin_name.

Referenced by initEnvironment().

+ Here is the caller graph for this function:

Member Function Documentation

◆ achieve()

ilPluginLanguageUpdatedObjective::achieve ( Setup\Environment  $environment)

Definition at line 73 of file class.ilPluginLanguageUpdatedObjective.php.

73 : Setup\Environment
74 {
75 $component_repository = $environment->getResource(Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
76 [$ORIG_DIC, $ORIG_ilDB] = $this->initEnvironment($environment, $component_repository);
77
78 $plugin = $component_repository->getPluginByName($this->plugin_name);
79 $language_handler = new ilPluginLanguage($plugin);
80 $language_handler->updateLanguages();
81
82 $GLOBALS["DIC"] = $ORIG_DIC;
83 $GLOBALS["ilDB"] = $ORIG_ilDB;
84
85 return $environment;
86 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $GLOBALS, XapiProxy\$plugin, ILIAS\Setup\Environment\getResource(), and initEnvironment().

+ Here is the call graph for this function:

◆ getHash()

ilPluginLanguageUpdatedObjective::getHash ( )

Definition at line 36 of file class.ilPluginLanguageUpdatedObjective.php.

36 : string
37 {
38 return hash("sha256", self::class . $this->plugin_name);
39 }

◆ getLabel()

ilPluginLanguageUpdatedObjective::getLabel ( )

Definition at line 44 of file class.ilPluginLanguageUpdatedObjective.php.

44 : string
45 {
46 return "Update plugin language $this->plugin_name.";
47 }

◆ getPreconditions()

ilPluginLanguageUpdatedObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 60 of file class.ilPluginLanguageUpdatedObjective.php.

60 : array
61 {
62 return [
63 new \ilIniFilesLoadedObjective(),
64 new \ilDatabaseInitializedObjective(),
67 ];
68 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ initEnvironment()

ilPluginLanguageUpdatedObjective::initEnvironment ( Setup\Environment  $environment,
\ilComponentRepository  $component_repository 
)
protected

Definition at line 98 of file class.ilPluginLanguageUpdatedObjective.php.

98 : array
99 {
100 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
101 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
102 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
103 $component_factory = $environment->getResource(Setup\Environment::RESOURCE_COMPONENT_FACTORY);
104
105
106 // ATTENTION: This is a total abomination. It only exists to allow various
107 // sub components of the various readers to run. This is a memento to the
108 // fact, that dependency injection is something we want. Currently, every
109 // component could just service locate the whole world via the global $DIC.
110 $ORIG_DIC = $GLOBALS["DIC"];
111 $ORIG_ilDB = $GLOBALS["ilDB"];
112
113 $GLOBALS["DIC"] = new DI\Container();
114 $GLOBALS["DIC"]["ilDB"] = $db;
115 $GLOBALS["ilDB"] = $db;
116 $GLOBALS["DIC"]["ilIliasIniFile"] = $ini;
117 $GLOBALS["DIC"]["ilClientIniFile"] = $client_ini;
118 $GLOBALS["DIC"]["component.factory"] = $component_factory;
119 $GLOBALS["DIC"]["ilLog"] = new class () extends ilLogger {
120 public function __construct()
121 {
122 }
123 public function isHandling(int $a_level): bool
124 {
125 return true;
126 }
127 public function log(string $a_message, int $a_level = ilLogLevel::INFO): void
128 {
129 }
130 public function dump($a_variable, int $a_level = ilLogLevel::INFO): void
131 {
132 }
133 public function debug(string $a_message, array $a_context = array()): void
134 {
135 }
136 public function info(string $a_message): void
137 {
138 }
139 public function notice(string $a_message): void
140 {
141 }
142 public function warning(string $a_message): void
143 {
144 }
145 public function error(string $a_message): void
146 {
147 }
148 public function critical(string $a_message): void
149 {
150 }
151 public function alert(string $a_message): void
152 {
153 }
154 public function emergency(string $a_message): void
155 {
156 }
157 public function write(string $a_message, $a_level = ilLogLevel::INFO): void
158 {
159 }
160 public function writeLanguageLog(string $a_topic, string $a_lang_key): void
161 {
162 }
163 public function logStack(?int $a_level = null, string $a_message = ''): void
164 {
165 }
166 public function writeMemoryPeakUsage(int $a_level): void
167 {
168 }
169 };
170 $GLOBALS["DIC"]["ilLoggerFactory"] = new class () extends ilLoggerFactory {
171 public function __construct()
172 {
173 }
174 public static function getRootLogger(): ilLogger
175 {
176 return $GLOBALS["DIC"]["ilLog"];
177 }
178 public static function getLogger(string $a_component_id): ilLogger
179 {
180 return $GLOBALS["DIC"]["ilLog"];
181 }
182 };
183 $GLOBALS["ilLog"] = $GLOBALS["DIC"]["ilLog"];
184 $GLOBALS["DIC"]["ilBench"] = null;
185 $GLOBALS["DIC"]["lng"] = new ilLanguage('en');
186 $GLOBALS["DIC"]["lng"]->lang_user = "en";
187 $GLOBALS["DIC"]["ilias"] = null;
188 $GLOBALS["DIC"]["ilErr"] = null;
189 $GLOBALS["DIC"]["tree"] = new class () extends ilTree {
190 public function __construct()
191 {
192 }
193 };
194 $GLOBALS["DIC"]["ilAppEventHandler"] = new class () extends ilAppEventHandler {
195 public function __construct()
196 {
197 }
198 public function raise($a_component, $a_event, $a_parameter = ""): void
199 {
200 }
201 };
202 $GLOBALS["DIC"]["ilObjDataCache"] = new ilObjectDataCache();
203 $GLOBALS["DIC"]["ilSetting"] = new ilSetting();
204 $GLOBALS["DIC"]["component.repository"] = $component_repository;
205 $GLOBALS["DIC"]["objDefinition"] = new ilObjectDefinition();
206 $GLOBALS["DIC"]["rbacadmin"] = new class () extends ilRbacAdmin {
207 public function __construct()
208 {
209 }
210 };
211 $GLOBALS["DIC"]["rbacreview"] = new class () extends ilRbacReview {
212 public function __construct()
213 {
214 }
215 };
216 $GLOBALS["DIC"]["ilUser"] = new class () extends ilObjUser {
217 public function __construct()
218 {
219 $this->prefs["language"] = "en";
220 }
221 };
222
223 if (!defined('DEBUG')) {
224 define('DEBUG', false);
225 }
226
227 if (!defined("ILIAS_ABSOLUTE_PATH")) {
228 define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
229 }
230
231 if (!defined('SYSTEM_ROLE_ID')) {
232 define('SYSTEM_ROLE_ID', '2');
233 }
234
235 if (!defined("CLIENT_ID")) {
236 define('CLIENT_ID', $client_ini->readVariable('client', 'name'));
237 }
238
239 if (!defined("ILIAS_WEB_DIR")) {
240 define('ILIAS_WEB_DIR', dirname(__DIR__, 4) . "/data/");
241 }
242
243 return [$ORIG_DIC, $ORIG_ilDB];
244 }
error(string $a_errmsg)
Global event handler.
language handling
Component logger with individual log levels by component id.
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parses the objects.xml it handles the xml-description of all ilias objects
Class ilRbacAdmin Core functions for role based access control.
class ilRbacReview Contains Review functions of core Rbac.
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...
$ini
Definition: raiseError.php:4

References $GLOBALS, $ini, __construct(), error(), ilLogLevel\INFO, and ILIAS\UI\examples\MessageBox\Info\info().

Referenced by achieve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isApplicable()

ilPluginLanguageUpdatedObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 91 of file class.ilPluginLanguageUpdatedObjective.php.

91 : bool
92 {
93 $component_repository = $environment->getResource(Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
94
95 return $component_repository->getPluginByName($this->plugin_name)->supportsCLISetup();
96 }

◆ isNotable()

ilPluginLanguageUpdatedObjective::isNotable ( )

Definition at line 52 of file class.ilPluginLanguageUpdatedObjective.php.

52 : bool
53 {
54 return true;
55 }

Field Documentation

◆ $plugin_name

string ilPluginLanguageUpdatedObjective::$plugin_name
protected

Definition at line 26 of file class.ilPluginLanguageUpdatedObjective.php.

Referenced by __construct().


The documentation for this class was generated from the following file: