Database Update class.
More...
◆ __construct()
◆ applyUpdate()
ilPluginDBUpdate::applyUpdate |
( |
| ) |
|
Apply update.
- Returns
- false|void
Definition at line 126 of file class.ilPluginDBUpdate.php.
References $current_version, $file_version, $ilDB, ilDBUpdate\applyUpdateNr(), ilDBUpdate\initGlobalsRequiredForUpdateSteps(), and null.
128 $ilCtrlStructureReader =
null;
135 $this->updateMsg =
'no_changes';
140 $msg[] =
'msg: update_error - ' . $this->error .
'; nr: ' . $i .
';';
141 $this->updateMsg = implode(
"\n", $msg);
146 $msg[] =
'msg: update_applied; nr: ' . $i .
';';
149 $this->updateMsg = implode(
'\n', $msg);
applyUpdateNr(int $nr, bool $custom_update=false)
Apply a custom database update or a plugin update.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
initGlobalsRequiredForUpdateSteps(?ilCtrlStructureReader &$ilCtrlStructureReader, ?ilDBInterface &$ilDB)
◆ checkQuery()
ilPluginDBUpdate::checkQuery |
( |
string |
$q | ) |
|
|
protected |
◆ getCurrentVersion()
ilPluginDBUpdate::getCurrentVersion |
( |
| ) |
|
◆ getDBUpdateScriptName()
ilPluginDBUpdate::getDBUpdateScriptName |
( |
| ) |
|
|
private |
◆ getTablePrefix()
ilPluginDBUpdate::getTablePrefix |
( |
| ) |
|
|
private |
Definition at line 110 of file class.ilPluginDBUpdate.php.
Referenced by checkQuery().
112 $component = $this->plugin->getComponent();
113 $slot = $this->plugin->getPluginSlot();
114 return $component->getId() .
'_' . $slot->getId() .
'_' . $this->plugin->getId();
◆ readDBUpdateFile()
ilPluginDBUpdate::readDBUpdateFile |
( |
| ) |
|
|
private |
Definition at line 63 of file class.ilPluginDBUpdate.php.
Referenced by __construct().
65 if (!file_exists($this->db_update_file)) {
66 $this->error =
'no_db_update_file';
67 $this->filecontent = [];
71 $this->filecontent = @file($this->db_update_file);
◆ readFileVersion()
ilPluginDBUpdate::readFileVersion |
( |
| ) |
|
|
private |
◆ setCurrentVersion()
ilPluginDBUpdate::setCurrentVersion |
( |
?int |
$a_version | ) |
|
|
protected |
◆ $current_version
int ilPluginDBUpdate::$current_version |
|
private |
◆ $db_update_file
string ilPluginDBUpdate::$db_update_file |
|
private |
◆ $file_version
int ilPluginDBUpdate::$file_version = null |
|
private |
◆ $plugin
◆ PLUGIN_UPDATE_FILE
const ilPluginDBUpdate::PLUGIN_UPDATE_FILE = "/sql/dbupdate.php" |
|
protected |
The documentation for this class was generated from the following file: