Commit 2a190d01 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch '4996-log-qfq-version-update' into 'master'

Feature #4996 - Log QFQ Version update

See merge request !65
parents 8f222b7f 867c1e58
Pipeline #769 passed with stage
in 1 minute and 38 seconds
......@@ -949,4 +949,11 @@ class Database {
} while ($this->mysqli->more_results() && $this->mysqli->next_result());
}
/**
*
*/
public function getQfqLogFile() {
return ($this->store == null) ? SYSTEM_QFQ_LOG_FILE : $this->store->getVar(SYSTEM_QFQ_LOG, STORE_SYSTEM);
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@
namespace qfq;
require_once(__DIR__ . '/../exceptions/CodeException.php');
require_once(__DIR__ . '/../helper/Logger.php');
require_once(__DIR__ . '/Database.php');
/*
......@@ -110,6 +111,7 @@ class DatabaseUpdate {
*
* @throws CodeException
* @throws DbException
* @throws UserFormException
*/
public function checkNupdate($dbUpdate) {
......@@ -124,6 +126,9 @@ class DatabaseUpdate {
$this->dbUpdateStatements($old, $new);
$this->db->playSqlFile(__DIR__ . '/../../sql/formEditor.sql');
$qfqLog = $this->db->getQfqLogFile();
Logger::logMessage("Updated from QFQ version '$old' to '$new'", $qfqLog);
// Finally write the latest version number.
$this->setDatabaseVersion($new);
}
......
......@@ -37,7 +37,7 @@ class Logger {
if (!$handle = fopen($filename, $mode)) {
// If open fails, maybe die directory does not exist. Create it:
// If open fails, maybe the directory does not exist. Create it:
Support::mkDirParent($filename);
// Try to open the file a second time.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment