4 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
26 if ($hotfixavailable || $this->hotfix_file_version_ea > $this->hotfix_current_version_ea)
48 $this->hotfix_setting->set(
"db_hotfixes_ea", $a_version);
49 $this->hotfix_current_version = $a_version;
67 if ($this->hotfix_info_read_ea && !$a_force)
71 include_once
'./Services/Administration/classes/class.ilSetting.php';
73 $this->hotfix_setting_ea =
new ilSetting();
74 $hotfix_file = $this->PATH.
"setup/sql/ilias_ea_dbfixes.php";
75 if (is_file($hotfix_file))
77 $this->hotfix_content_ea = @file($hotfix_file);
78 $this->hotfix_current_version_ea = (int) $this->hotfix_setting_ea->get(
"db_hotfixes_ea");
81 $this->hotfix_info_read_ea =
true;
95 reset($this->filecontent);
101 while (!ereg(
"^<#".$nr.
">", $this->filecontent[$i]) && $i<count($this->filecontent))
107 if ($i == count($this->filecontent))
109 $this->error =
"update_not_found";
117 while ($i<count($this->filecontent) && !ereg(
"^<#".($nr+1).
">", $this->filecontent[$i]))
119 $update[] = trim($this->filecontent[$i]);
128 foreach ($update as
$row)
130 if (ereg(
"<\?php", $row))
134 if ($this->
execQuery($this->db, implode(
"\n", $sql)) ==
false)
143 elseif (ereg(
"\?>", $row))
147 $code = implode(
"\n", $php);
168 if ($mode ==
"sql" && count($sql) > 0)
170 if ($this->
execQuery($this->db, implode(
"\n", $sql)) ==
false)
172 $this->error =
"dump_error: ".$this->error;
216 include_once
'./Services/Database/classes/class.ilMySQLAbstraction.php';
219 $GLOBALS[
'ilMySQLAbstraction'] = $ilMySQLAbstraction;
229 for ($i=($c+1); $i<=
$f; $i++)
231 $this->filecontent = $this->hotfix_content_ea;
235 "msg" =>
"update_error: ".$this->error,
238 $this->updateMsg = $msg;
244 "msg" =>
"hotfix_applied",
250 $this->updateMsg = $msg;
254 $this->updateMsg =
"no_changes";