19declare(strict_types=1);
50 $this->client_ini =
null;
61 $class_map = require ILIAS_ABSOLUTE_PATH .
'/vendor/composer/vendor/composer/autoload_classmap.php';
67 if (!file_exists($this->db_update_file)) {
68 $this->
error =
'no_db_update_file';
69 $this->filecontent = [];
73 $this->filecontent = @file($this->db_update_file);
79 reset($this->filecontent);
82 foreach ($this->filecontent as $row) {
83 if (preg_match(
'/^<\#([0-9]+)>/', $row, $regs)) {
98 $this->current_version = $a_version;
103 if ((is_int(stripos(
$q,
'create table')) || is_int(stripos(
$q,
'alter table')) ||
104 is_int(stripos(
$q,
'drop table')))
114 $component = $this->plugin->getComponent();
115 $slot = $this->plugin->getPluginSlot();
116 return $component->getId() .
'_' . $slot->getId() .
'_' . $this->plugin->getId();
130 $ilCtrlStructureReader =
null;
137 $this->updateMsg =
'no_changes';
142 $msg[] =
'msg: update_error - ' . $this->
error .
'; nr: ' . $i .
';';
143 $this->updateMsg = implode(
"\n", $msg);
148 $msg[] =
'msg: update_applied; nr: ' . $i .
';';
151 $this->updateMsg = implode(
'\n', $msg);
Class ilCtrlArrayIterator.
initGlobalsRequiredForUpdateSteps(?ilCtrlStructureReader &$ilCtrlStructureReader, ?ilDBInterface &$ilDB)
applyUpdateNr(int $nr, bool $custom_update=false)
Apply a custom database update or a plugin update.
applyUpdate()
Apply update.
__construct(\ilDBInterface $db, \ilPluginInfo $plugin)
constructor @noinspection MagicMethodsValidityInspection
setCurrentVersion(?int $a_version)
Simple value class for information about a plugin.