ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 25 of file class.ilPluginLanguageUpdatedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginLanguageUpdatedObjective::__construct ( string  $plugin_name)

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

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

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 74 of file class.ilPluginLanguageUpdatedObjective.php.

74 : Setup\Environment
75 {
76 $component_repository = $environment->getResource(Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
77 [$ORIG_DIC, $ORIG_ilDB] = $this->initEnvironment($environment, $component_repository);
78
79 $plugin = $component_repository->getPluginByName($this->plugin_name);
80 $language_handler = new ilPluginLanguage($plugin);
81 $language_handler->updateLanguages();
82
83 $GLOBALS["DIC"] = $ORIG_DIC;
84 $GLOBALS["ilDB"] = $ORIG_ilDB;
85
86 return $environment;
87 }
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository)
$GLOBALS["DIC"]
Definition: wac.php:54

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

+ Here is the call graph for this function:

◆ getHash()

ilPluginLanguageUpdatedObjective::getHash ( )

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

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

◆ getLabel()

ilPluginLanguageUpdatedObjective::getLabel ( )

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

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

◆ getPreconditions()

ilPluginLanguageUpdatedObjective::getPreconditions ( Setup\Environment  $environment)

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

61 : array
62 {
63 return [
64 new \ilIniFilesLoadedObjective(),
65 new \ilDatabaseInitializedObjective(),
68 ];
69 }
language handling for setup

◆ initEnvironment()

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

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

99 : array
100 {
101 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
102 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
103 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
104 $component_factory = $environment->getResource(Setup\Environment::RESOURCE_COMPONENT_FACTORY);
105
106
107 // ATTENTION: This is a total abomination. It only exists to allow various
108 // sub components of the various readers to run. This is a memento to the
109 // fact, that dependency injection is something we want. Currently, every
110 // component could just service locate the whole world via the global $DIC.
111 $ORIG_DIC = $GLOBALS["DIC"];
112 $ORIG_ilDB = $GLOBALS["ilDB"];
113
114 $GLOBALS["DIC"] = new DI\Container();
115 $GLOBALS["DIC"]["ilDB"] = $db;
116 $GLOBALS["ilDB"] = $db;
117 $GLOBALS["DIC"]["ilIliasIniFile"] = $ini;
118 $GLOBALS["DIC"]["ilClientIniFile"] = $client_ini;
119 $GLOBALS["DIC"]["ilLog"] = new NullLogger();
120 $GLOBALS["DIC"]["ilLoggerFactory"] = new class () extends ilLoggerFactory {
121 public function __construct()
122 {
123 }
124 public static function getRootLogger(): ilLogger
125 {
126 return $GLOBALS["DIC"]["ilLog"];
127 }
128 public static function getLogger(string $a_component_id): ilLogger
129 {
130 return $GLOBALS["DIC"]["ilLog"];
131 }
132 };
133 $GLOBALS["ilLog"] = $GLOBALS["DIC"]["ilLog"];
134 $GLOBALS["DIC"]["ilBench"] = null;
135 $GLOBALS["DIC"]["lng"] = new ilLanguage('en');
136 $GLOBALS["DIC"]["lng"]->lang_user = "en";
137 $GLOBALS["DIC"]["ilias"] = null;
138 $GLOBALS["DIC"]["ilErr"] = null;
139 $GLOBALS["DIC"]["tree"] = new class () extends ilTree {
140 public function __construct()
141 {
142 }
143 };
144 $GLOBALS["DIC"]["ilAppEventHandler"] = new class () extends ilAppEventHandler {
145 public function __construct()
146 {
147 }
148 public function raise($a_component, $a_event, $a_parameter = ""): void
149 {
150 }
151 };
152 $GLOBALS["DIC"]["ilObjDataCache"] = new ilObjectDataCache();
153 $GLOBALS["DIC"]["ilSetting"] = new ilSetting();
154 $GLOBALS["DIC"]["component.repository"] = $component_repository;
155 $GLOBALS["DIC"]["component.factory"] = $component_factory;
156 $GLOBALS["DIC"]["objDefinition"] = new ilObjectDefinition();
157 $GLOBALS["DIC"]["rbacadmin"] = new class () extends ilRbacAdmin {
158 public function __construct()
159 {
160 }
161 };
162 $GLOBALS["DIC"]["rbacreview"] = new class () extends ilRbacReview {
163 public function __construct()
164 {
165 }
166 };
167 $GLOBALS["DIC"]["ilUser"] = new class () extends ilObjUser {
168 public function __construct()
169 {
170 $this->prefs["language"] = "en";
171 }
172 };
173
174 if (!defined('DEBUG')) {
175 define('DEBUG', false);
176 }
177
178 if (!defined("ILIAS_ABSOLUTE_PATH")) {
179 define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 6));
180 }
181
182 if (!defined('SYSTEM_ROLE_ID')) {
183 define('SYSTEM_ROLE_ID', '2');
184 }
185
186 if (!defined("CLIENT_ID")) {
187 define('CLIENT_ID', $client_ini->readVariable('client', 'name'));
188 }
189
190 if (!defined("ILIAS_WEB_DIR")) {
191 define('ILIAS_WEB_DIR', $ini->readVariable('clients', 'path'));
192 }
193
194 return [$ORIG_DIC, $ORIG_ilDB];
195 }
Global event handler.
language handling
Component logger with individual log levels by component id.
User class.
class ilObjectDataCache
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.
ILIAS Setting Class.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$ini
Definition: raiseError.php:20

References $GLOBALS, $ini, and __construct().

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 92 of file class.ilPluginLanguageUpdatedObjective.php.

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

◆ isNotable()

ilPluginLanguageUpdatedObjective::isNotable ( )

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

53 : bool
54 {
55 return true;
56 }

Field Documentation

◆ $plugin_name

string ilPluginLanguageUpdatedObjective::$plugin_name
protected

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

Referenced by __construct().


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