ILIAS  release_7 Revision v7.30-3-g800a261c036
ilComponentUpdatePluginObjective Class Reference
+ Inheritance diagram for ilComponentUpdatePluginObjective:
+ Collaboration diagram for ilComponentUpdatePluginObjective:

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)
 

Protected Attributes

 $plugin_name
 

Detailed Description

Definition at line 10 of file class.ilComponentUpdatePluginObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilComponentUpdatePluginObjective::__construct ( string  $plugin_name)

Definition at line 17 of file class.ilComponentUpdatePluginObjective.php.

References $plugin_name.

Referenced by initEnvironment().

+ Here is the caller graph for this function:

Member Function Documentation

◆ achieve()

ilComponentUpdatePluginObjective::achieve ( Setup\Environment  $environment)

Definition at line 62 of file class.ilComponentUpdatePluginObjective.php.

62 : Setup\Environment
63 {
64 list($ORIG_DIC, $ORIG_ilDB) = $this->initEnvironment($environment);
65
66 $plugin = $GLOBALS["DIC"]["ilPluginAdmin"]->getRawPluginDataFor($this->plugin_name);
67
68 if (!is_null($plugin) && $plugin['needs_update'] && $plugin['supports_cli_setup']) {
70 $plugin['component_type'],
71 $plugin['component_name'],
72 $plugin['slot_id'],
73 $plugin['name']
74 );
75
76 $pl->update();
77 }
78
79 $GLOBALS["DIC"] = $ORIG_DIC;
80 $GLOBALS["ilDB"] = $ORIG_ilDB;
81
82 return $environment;
83 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)

References $GLOBALS, XapiProxy\$plugin, ilPlugin\getPluginObject(), and initEnvironment().

+ Here is the call graph for this function:

◆ getHash()

ilComponentUpdatePluginObjective::getHash ( )

Definition at line 25 of file class.ilComponentUpdatePluginObjective.php.

25 : string
26 {
27 return hash("sha256", self::class . $this->plugin_name);
28 }

◆ getLabel()

ilComponentUpdatePluginObjective::getLabel ( )

Definition at line 33 of file class.ilComponentUpdatePluginObjective.php.

33 : string
34 {
35 return "Update plugin $this->plugin_name.";
36 }

◆ getPreconditions()

ilComponentUpdatePluginObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 49 of file class.ilComponentUpdatePluginObjective.php.

49 : array
50 {
51 return [
53 new \ilIniFilesLoadedObjective(),
54 new \ilDatabaseInitializedObjective(),
55 new \ilComponentPluginAdminInitObjective()
56 ];
57 }
Read the client id of the installation from the data directory.

◆ initEnvironment()

ilComponentUpdatePluginObjective::initEnvironment ( Setup\Environment  $environment)
protected

Definition at line 104 of file class.ilComponentUpdatePluginObjective.php.

104 : array
105 {
106 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
107 $plugin_admin = $environment->getResource(Setup\Environment::RESOURCE_PLUGIN_ADMIN);
108 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
109 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
110
111
112 // ATTENTION: This is a total abomination. It only exists to allow various
113 // sub components of the various readers to run. This is a memento to the
114 // fact, that dependency injection is something we want. Currently, every
115 // component could just service locate the whole world via the global $DIC.
116 $ORIG_DIC = $GLOBALS["DIC"];
117 $ORIG_ilDB = $GLOBALS["ilDB"];
118
119 $GLOBALS["DIC"] = new DI\Container();
120 $GLOBALS["DIC"]["ilDB"] = $db;
121 $GLOBALS["ilDB"] = $db;
122 $GLOBALS["DIC"]["ilIliasIniFile"] = $ini;
123 $GLOBALS["DIC"]["ilClientIniFile"] = $client_ini;
124 $GLOBALS["DIC"]["ilLogger"] = new class() extends ilLogger {
125 public function __construct()
126 {
127 }
128 public function isHandling($a_level)
129 {
130 return true;
131 }
132 public function log($a_message, $a_level = ilLogLevel::INFO)
133 {
134 }
135 public function dump($a_variable, $a_level = ilLogLevel::INFO)
136 {
137 }
138 public function debug($a_message, $a_context = array())
139 {
140 }
141 public function info($a_message)
142 {
143 }
144 public function notice($a_message)
145 {
146 }
147 public function warning($a_message)
148 {
149 }
150 public function error($a_message)
151 {
152 }
153 public function critical($a_message)
154 {
155 }
156 public function alert($a_message)
157 {
158 }
159 public function emergency($a_message)
160 {
161 }
162 public function write($a_message, $a_level = ilLogLevel::INFO)
163 {
164 }
165 public function writeLanguageLog($a_topic, $a_lang_key)
166 {
167 }
168 public function logStack($a_level = null, $a_message = '')
169 {
170 }
171 public function writeMemoryPeakUsage($a_level)
172 {
173 }
174 };
175 $GLOBALS["DIC"]["ilLog"] = new class() extends ilLog {
176 public function __construct()
177 {
178 }
179 public function write($m, $l = ilLogLevel::INFO)
180 {
181 }
182 public function info($msg)
183 {
184 }
185 public function warning($msg)
186 {
187 }
188 public function error($msg)
189 {
190 }
191 public function debug($msg, $a = [])
192 {
193 }
194 public function dump($msg, $a = ilLogLevel::INFO)
195 {
196 }
197 };
198 $GLOBALS["DIC"]["ilLoggerFactory"] = new class() extends ilLoggerFactory {
199 public function __construct()
200 {
201 }
202 public static function getRootLogger()
203 {
204 return $GLOBALS["DIC"]["ilLogger"];
205 }
206 public static function getLogger($a)
207 {
208 return $GLOBALS["DIC"]["ilLogger"];
209 }
210 };
211 $GLOBALS["ilLog"] = $GLOBALS["DIC"]["ilLog"];
212 $GLOBALS["DIC"]["ilBench"] = null;
213 $GLOBALS["DIC"]["lng"] = new ilLanguage('en');
214 $GLOBALS["DIC"]["ilPluginAdmin"] = $plugin_admin;
215 $GLOBALS["DIC"]["ilCtrl"] = new ilCtrl();
216 $GLOBALS["DIC"]["ilias"] = null;
217 $GLOBALS["DIC"]["ilErr"] = null;
218 $GLOBALS["DIC"]["tree"] = new class() extends ilTree {
219 public function __construct()
220 {
221 }
222 };
223 $GLOBALS["DIC"]["ilAppEventHandler"] = new class() extends ilAppEventHandler {
224 public function __construct()
225 {
226 }
227 public function raise($a_component, $a_event, $a_parameter = "") : void
228 {
229 }
230 };
231 $GLOBALS["DIC"]["ilObjDataCache"] = new ilObjectDataCache();
232 $GLOBALS["DIC"]["ilSetting"] = new ilSetting();
233 $GLOBALS["DIC"]["objDefinition"] = new ilObjectDefinition();
234 $GLOBALS["DIC"]["rbacadmin"] = new class() extends ilRbacAdmin {
235 public function __construct()
236 {
237 }
238 };
239 $GLOBALS["DIC"]["rbacreview"] = new class() extends ilRbacReview {
240 public function __construct()
241 {
242 }
243 };
244 $GLOBALS["DIC"]["ilUser"] = new class() extends ilObjUser {
245 public $prefs = [];
246
247 public function __construct()
248 {
249 $this->prefs["language"] = "en";
250 }
251 };
252
253 if (!defined('DEBUG')) {
254 define('DEBUG', false);
255 }
256
257 if (!defined("ILIAS_ABSOLUTE_PATH")) {
258 define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
259 }
260
261 if (!defined('SYSTEM_ROLE_ID')) {
262 define('SYSTEM_ROLE_ID', '2');
263 }
264
265 if (!defined("CLIENT_ID")) {
266 define('CLIENT_ID', $client_ini->readVariable('client', 'name'));
267 }
268
269 if (!defined("ILIAS_WEB_DIR")) {
270 define('ILIAS_WEB_DIR', dirname(__DIR__, 4) . "/data/");
271 }
272
273 return [$ORIG_DIC, $ORIG_ilDB];
274 }
error($a_errmsg)
set error message @access public
Global event handler.
This class provides processing control methods.
language handling
logging
Definition: class.ilLog.php:19
Component logger with individual log levels by component id.
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...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$ini
Definition: raiseError.php:4
info()
Definition: info.php:2

References Vendor\Package\$a, $GLOBALS, $ini, __construct(), error(), ilLogLevel\INFO, and info().

Referenced by achieve(), and isApplicable().

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

◆ isApplicable()

ilComponentUpdatePluginObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 88 of file class.ilComponentUpdatePluginObjective.php.

88 : bool
89 {
90 list($ORIG_DIC, $ORIG_ilDB) = $this->initEnvironment($environment);
91
92 $plugin = $GLOBALS["DIC"]["ilPluginAdmin"]->getRawPluginDataFor($this->plugin_name);
93
94 if (is_null($plugin) || !$plugin['supports_cli_setup']) {
95 return false;
96 }
97
98 $GLOBALS["DIC"] = $ORIG_DIC;
99 $GLOBALS["ilDB"] = $ORIG_ilDB;
100
101 return $plugin['needs_update'];
102 }

References $GLOBALS, XapiProxy\$plugin, and initEnvironment().

+ Here is the call graph for this function:

◆ isNotable()

ilComponentUpdatePluginObjective::isNotable ( )

Definition at line 41 of file class.ilComponentUpdatePluginObjective.php.

41 : bool
42 {
43 return true;
44 }

Field Documentation

◆ $plugin_name

ilComponentUpdatePluginObjective::$plugin_name
protected

Definition at line 15 of file class.ilComponentUpdatePluginObjective.php.

Referenced by __construct().


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