Commit 4b0d1413 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3766 / SQL_LOG per tt_content record einstellbar machen

Add `sqlLog` and `sqlLogMode` to QFQ tt-content records.
Add mode 'error' and `none` to sqlLogMode.
Manual.rst: Added explanations for SQL_LOG, SQL_LOG_MODE, and tt-content pendants sqlLog, sqlLogMode. Update config.qfq.ini to latest attributes.
Database.php: rename $mode to $currentQueryMode to make it more descriptive. Recode dbLog().
Logger.php: do nothing if there is no file defined.
Report.php: new function checkUpdateLog().
Config.php: Set defaults for config.qfq.ini SQL_LOG and SQL_LOG_MODE
Store.php: Fix problem that an empty SQL_LOG will be prependad with SYSTEM_PATH_EXT.
parent de0ec670
......@@ -67,7 +67,7 @@ Preparation steps for Ubuntu 16.04::
sudo apt install php7.0-intl
sudo apt install pdftk libxrender1 file # for file upload, PDF and 'HTML to PDF' (wkhtmltopdf)
.. _wkhtmltopdf:
.. _wkhtml:
wkhtmltopdf
^^^^^^^^^^^
......@@ -235,11 +235,11 @@ config.qfq.ini
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
| | | *modify*: log only statements who change data |
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this might a lot. |
| | | *modify*: log only statements who change data. |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: yes|no|auto|download. For 'auto': If a BE User is logged |
| | | in, a debug information will be shown on the fronend. |
| SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | FE - Possible values: yes|no|auto|download. For 'auto': If a BE User is |
| | | logged in, a debug information will be shown on the FE. |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| REDIRECT_ALL_MAIL_TO | REDIRECT_ALL_MAIL_TO=john@doe.com | If set, redirect all QFQ generated mails (Form, Report) to the specified. |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
......@@ -250,6 +250,8 @@ config.qfq.ini
| CSS_CLASS_QFQ_CONTAINER |CSS_CLASS_QFQ_CONTAINER=container | QFQ with own Bootstrap: 'container'. |
| | | QFQ already nested in Bootstrap of mainpage: <empty> |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM | CSS_CLASS_QFQ_FORM=qfq-color-base | Wrap around QFQ 'Form' |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_PILL |CSS_CLASS_QFQ_FORM_PILL=qfq-color-grey-1 | Wrap around title bar for pills: CSS Class, typically a background color |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_BODY |CSS_CLASS_QFQ_FORM_BODY=qfq-color-grey-2 | Wrap around formelements: CSS Class, typically a background color |
......@@ -305,33 +307,36 @@ Example: *typo3conf/config.qfq.ini*
DB_PASSWORD = 12345678
DB_NAME = qfq_db
DB_INIT = set names utf8
SQL_LOG = sql.log
SHOW_DEBUG_INFO = auto
; SQL_LOG = sql.log
; SQL_LOG_MODE = modify
; SHOW_DEBUG_INFO = auto
; REDIRECT_ALL_MAIL_TO = john.doe@example.com
CSS_LINK_CLASS_INTERNAL = internal
CSS_LINK_CLASS_EXT = external
;CSS_CLASS_QFQ_CONTAINER =
;CSS_CLASS_QFQ_FORM =
; CSS_CLASS_QFQ_CONTAINER =
; CSS_CLASS_QFQ_FORM =
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
;DATE_FORMAT= yyyy-mm-dd
;FORM_DATA_PATTERN_ERROR =
;FORM_DATA_REQUIRED_ERROR =
;FORM_DATA_MATCH_ERROR =
;FORM_DATA_ERROR =
;FORM_BS_COLUMNS = 12
;FORM_BS_LABEL_COLUMNS = 3
;FORM_BS_INPUT_COLUMNS = 6
;FORM_BS_NOTE_COLUMNS = 3
BASE_URL_PRINT=http://example.com
; DATE_FORMAT= yyyy-mm-dd
; TECHNICAL CONTACT = john@doe.com
; FORM_DATA_PATTERN_ERROR =
; FORM_DATA_REQUIRED_ERROR =
; FORM_DATA_MATCH_ERROR =
; FORM_DATA_ERROR =
; FORM_BS_COLUMNS = 12
; FORM_BS_LABEL_COLUMNS = 3
; FORM_BS_INPUT_COLUMNS = 6
; FORM_BS_NOTE_COLUMNS = 3
BASE_URL_PRINT=http://example.com/
WKHTMLTOPDF=/usr/bin/wkhtmltopdf
;EDIT_FORM_PAGE = form
;LDAP_1_RDN='ou=Admin,dc=example,dc=com'
;LDAP_1_PASSWORD=mySecurePassword
;ESCAPE_TYPE_DEFAULT=s
;SECURITY_VARS_HONEYPOT=email,username,password
;SECURITY_ATTACK_DELAY=5
;SECURITY_SHOW_MESSAGE=true
;SECURITY_GET_MAX_LENGTH=32
; EDIT_FORM_PAGE = form
; LDAP_1_RDN='ou=Admin,dc=example,dc=com'
; LDAP_1_PASSWORD=mySecurePassword
; ESCAPE_TYPE_DEFAULT=s
; SECURITY_VARS_HONEYPOT=email,username,password
; SECURITY_ATTACK_DELAY=5
; SECURITY_SHOW_MESSAGE=true
; SECURITY_GET_MAX_LENGTH=50
..
......@@ -452,7 +457,11 @@ QFQ Keywords (Bodytext)
+-------------------+---------------------------------------------------------------------------------+
| <level>.althead | If <level>.sql is empty, these token will be rendered |
+-------------------+---------------------------------------------------------------------------------+
| debugShowBodyText | If='1' and config.qfq.ini:*SHOW_DEBUG_INFO =yes*, shows a tooltip with bodytext |
| debugShowBodyText | If='1' and config.qfq.ini:*SHOW_DEBUG_INFO = yes*, shows a tooltip with bodytext|
+-------------------+---------------------------------------------------------------------------------+
| sqlLog | Overwrites config.qfq.ini: `SQL_LOG`_ . Only affects `Report`, not `Form`. |
+-------------------+---------------------------------------------------------------------------------+
| sqlLogMode | Overwrites config.qfq.ini: `SQL_LOG_MODE`_ . Only affects `Report`, not `Form`. |
+-------------------+---------------------------------------------------------------------------------+
.. _debug:
......@@ -460,9 +469,32 @@ QFQ Keywords (Bodytext)
Debug
^^^^^
`config.qfq.ini`_
File: `config.qfq.ini`_
.. _SQL_LOG:
* *SQL_LOG*
* Filename where to log SQL queries and statistical data.
* File is relative to the extension directory or absolute (starting with '/').
* Content: SQL queries and timestamp, formName/formId, fe_user, success, affected rows, newly created record
id's and accessed from IP.
* The global setting can be overwritten by defining `sqlLog` inside of a QFQ tt-content record.
* *SHOW_DEBUG_INFO = yes|no|auto|download*
.. _SQL_LOG_MODE:
* *SQL_LOG_MODE = all|modify|error|none*
* *all*: logs every SQL statement.
* *modify*: logs only statements who might potentially change data.
* *error*: logs only queries which generate SQL errors.
* *none*: no query logging at all.
* The global setting can be overwritten by defining `sqlLogMode` inside of a QFQ tt-content record.
* *SHOW_DEBUG_INFO = [yes|no|auto],[download]*
If active, displays additional information in the Frontend (FE). This is typically helpful during development.
* *yes*:
......@@ -485,7 +517,7 @@ Debug
* *download*:
* During a download (especially by using wkhtml), temporary files are not deleted automatically. Also the
`wkhtmltopdf` and `pdftk` commandlines will be logged to SQL_LOG. Use this only to debug problems on download.
`wkhtmltopdf` and `pdftk` commandlines will be logged to `SQL_LOG`_. Use this only to debug problems on download.
.. _REDIRECT_ALL_MAIL_TO:
......@@ -605,6 +637,7 @@ Sanitize class
| **all** | Form | Query | no sanitizing |
+------------------+------+-------+-----------------------------------------------------------------------------------------+
..
Security
========
......@@ -963,53 +996,53 @@ Store: *SYSTEM* - Y
+-------------------------+--------------------------------------------------------------------------+
| Name | Explanation |
+=========================+==========================================================================+
| DB_USER | defined in config.ini |
| DB_USER | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| DB_SERVER | defined in config.ini |
| DB_SERVER | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| DB_NAME | defined in config.ini |
| DB_NAME | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| DB_INIT | defined in config.ini |
| DB_INIT | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| SQL_LOG | defined in config.ini |
| SQL_LOG | defined in config.qfq.ini, see `SQL_LOG`_ |
+-------------------------+--------------------------------------------------------------------------+
| SQL_LOG_MODE | defined in config.ini |
| SQL_LOG_MODE | defined in config.qfq.ini, `SQL_LOG_MODE`_ |
+-------------------------+--------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | defined in config.ini |
| SHOW_DEBUG_INFO | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL | defined in config.ini |
| CSS_LINK_CLASS_INTERNAL | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL | defined in config.ini |
| CSS_LINK_CLASS_EXTERNAL | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| CSS_CLASS_QFQ_CONTAINER | defined in config.ini |
| CSS_CLASS_QFQ_CONTAINER | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| EXT_PATH | computed during runtime |
+-------------------------+--------------------------------------------------------------------------+
| SITE_PATH | computed during runtime |
+-------------------------+--------------------------------------------------------------------------+
| DATE_FORMAT | defined in config.ini |
| DATE_FORMAT | defined in config.qfq.ini |
+-------------------------+--------------------------------------------------------------------------+
| class | defined in config.ini (CSS_CLASS_QFQ_FORM) or form definition |
| class | defined in config.qfq.ini (CSS_CLASS_QFQ_FORM) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| classPill | defined in config.ini (CSS_CLASS_QFQ_FORM_PILL) or form definition |
| classPill | defined in config.qfq.ini (CSS_CLASS_QFQ_FORM_PILL) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| classBody | defined in config.ini (CSS_CLASS_QFQ_FORM_BODY) or form definition |
| classBody | defined in config.qfq.ini (CSS_CLASS_QFQ_FORM_BODY) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| data-pattern-error | defined in config.ini or form definition |
| data-pattern-error | defined in config.qfq.ini or form definition |
+-------------------------+--------------------------------------------------------------------------+
| data-require-error | defined in config.ini or form definition |
| data-require-error | defined in config.qfq.ini or form definition |
+-------------------------+--------------------------------------------------------------------------+
| data-match-error | defined in config.ini or form definition |
| data-match-error | defined in config.qfq.ini or form definition |
+-------------------------+--------------------------------------------------------------------------+
| data-error | defined in config.ini or form definition |
| data-error | defined in config.qfq.ini or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsColumns | defined in config.ini (FORM_BS_COLUMNS) or form definition |
| bsColumns | defined in config.qfq.ini (FORM_BS_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsLabelColumns | defined in config.ini (FORM_BS_LABEL_COLUMNS) or form definition |
| bsLabelColumns | defined in config.qfq.ini (FORM_BS_LABEL_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsInputColumns | defined in config.ini (FORM_BS_INPUT_COLUMNS) or form definition |
| bsInputColumns | defined in config.qfq.ini (FORM_BS_INPUT_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsNoteColumns | defined in config.ini (FORM_BS_NOTE_COLUMNS) or form definition |
| bsNoteColumns | defined in config.qfq.ini (FORM_BS_NOTE_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| sqlFinal | computed during runtime, used for error reporting |
+-------------------------+--------------------------------------------------------------------------+
......@@ -2772,7 +2805,7 @@ Best for debugging is to specify in the tt-content record::
debugShowBodyText = 1
Note: Debug information is only display if it's enabled in *config.ini* by
Note: Debug information is only display if it's enabled in *config.qfq.ini* by
* *SHOW_DEBUG_INFO=yes* or
* *SHOW_DEBUG_INFO=auto* and logged in in the same Browser as a Typo3 backend user.
......@@ -3388,7 +3421,7 @@ The parsed bodytext could be displayed by activating 'SHOW_DEBUG_INFO ' (:ref:`d
debugShowBodyText = 1
A small symbol with a tooltip will be shown, where the content record will be displayed on the webpage.
Note: :ref:`debug` information will only be shown with *SHOW_DEBUG_INFO = yes* in config.ini .
Note: :ref:`debug` information will only be shown with *SHOW_DEBUG_INFO = yes* in config.qfq.ini .
Structure
---------
......
......@@ -12,7 +12,7 @@ DB_INIT = set names utf8
; '../../sql.log' = <T3 Install directory>/typo3conf/sql.log
SQL_LOG = ../../sql.log
; all, modify
; all|modify|error|none
SQL_LOG_MODE = modify
; [auto|yes|no][,download]. 'auto': if BE User is logged in the value will be replaced by 'yes', else 'no'. Additional choose 'download'.
......@@ -27,6 +27,7 @@ CSS_LINK_CLASS_EXTERNAL = external
;CSS_CLASS_QFQ_CONTAINER =
; Default background color, specified via CSS class
;CSS_CLASS_QFQ_FORM =
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
......
......@@ -17,7 +17,8 @@ class BodytextParser {
/**
* @param $bodytext
* @return mixed
* @return mixed|string
* @throws UserFormException
*/
public function process($bodytext) {
......
......@@ -316,6 +316,8 @@ const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
const TYPO3_SQL_LOG = 'sqlLog';
const TYPO3_SQL_LOG_MODE = 'sqlLogMode';
// System
const SYSTEM_DB_USER = 'DB_USER';
......@@ -325,6 +327,7 @@ const SYSTEM_DB_NAME = 'DB_NAME';
const SYSTEM_DB_NAME_TEST = 'DB_NAME_TEST';
const SYSTEM_DB_INIT = 'DB_INIT';
const SYSTEM_SQL_LOG = 'SQL_LOG'; // Logging to file
const SYSTEM_SQL_LOG_FILE = '../../sql.log';
const SYSTEM_SQL_LOG_MODE = 'SQL_LOG_MODE'; // Mode, which statements to log.
const SYSTEM_DATE_FORMAT = 'DATE_FORMAT';
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'REDIRECT_ALL_MAIL_TO';
......@@ -487,7 +490,7 @@ const TOKEN_FORM = CLIENT_FORM;
const TOKEN_RECORD_ID = CLIENT_RECORD_ID;
const TOKEN_DEBUG_BODYTEXT = TYPO3_DEBUG_SHOW_BODY_TEXT;
const TOKEN_VALID_LIST = 'sql|head|althead|tail|rbeg|rend|renr|rsep|fbeg|fend|fsep|rbgd|debug|form|r|debugShowBodyText';
const TOKEN_VALID_LIST = 'sql|head|althead|tail|rbeg|rend|renr|rsep|fbeg|fend|fsep|rbgd|debug|form|r|debugShowBodyText|sqlLog|sqlLogMode';
// FORM - copy from table 'form' of processed form
//const DEF_FORM_NAME = CLIENT_FORM;
......@@ -498,7 +501,8 @@ const TOKEN_VALID_LIST = 'sql|head|althead|tail|rbeg|rend|renr|rsep|fbeg|fend|fs
// SQL logging Modes
const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';
const SQL_LOG_MODE_ERROR = 'error'; // write log entry, independent of global setting (e.g. broken Query)
const SQL_LOG_MODE_NONE = 'none';
const SQL_LOG_MODE_ERROR = 'error';
const MODE_LDAP_PREFETCH = 'ldapPrefetch';
const MODE_LDAP_SINGLE = 'ldapSingle';
......
......@@ -825,6 +825,7 @@ class QuickFormQuery {
* @return string
*/
private function doReport() {
$report = new Report($this->t3data, $this->eval, $this->phpUnit);
$html = $report->process($this->t3data['bodytext']);
......
......@@ -56,6 +56,11 @@ class Database {
*/
private $sqlLog = '';
/**
* @var array
*/
private $sqlLogModePrio = [SQL_LOG_MODE_NONE => 1, SQL_LOG_MODE_ERROR => 2, SQL_LOG_MODE_MODIFY => 3, SQL_LOG_MODE_ALL => 4];
/**
* Returns current data base handle from Store[System][SYSTEM_DBH].
* If not exists: open database and store the new dbh in Store[System][SYSTEM_DBH]
......@@ -93,8 +98,6 @@ class Database {
}
/**
* Open mysqli database connection if not already done.
*
......@@ -252,7 +255,7 @@ class Database {
*/
private function prepareExecute($sql, array $parameterArray = array(), &$queryType, array &$stat) {
$sqlLogMode = $this->isSqlModify($sql) ? SQL_LOG_MODE_MODIFY : SQL_LOG_MODE_ALL;;
$sqlLogMode = $this->isSqlModify($sql) ? SQL_LOG_MODE_MODIFY : SQL_LOG_MODE_ALL;
$result = 0;
$stat = array();
......@@ -346,7 +349,9 @@ class Database {
* @return bool true is the statement might modify data, else: false
*/
private function isSqlModify($sql) {
$command = explode(' ', $sql, 2);
switch (strtoupper($command[0])) {
case 'INSERT':
case 'UPDATE':
......@@ -355,6 +360,7 @@ class Database {
case 'TRUNCATE':
return true;
}
return false;
}
......@@ -366,28 +372,27 @@ class Database {
* @return string
* @throws \qfq\UserFormException
*/
private function dbLog($mode = SQL_LOG_MODE_ALL, $sql = '', $parameterArray = array()) {
private function dbLog($currentQueryMode = SQL_LOG_MODE_ALL, $sql = '', $parameterArray = array()) {
$status = '';
$sqlLogMode = ($this->store === null) ? $this->store->getVar(SYSTEM_SQL_LOG_MODE, STORE_SYSTEM) : SQL_LOG_MODE_ERROR;
switch ($mode) {
case SQL_LOG_MODE_ALL:
if ($sqlLogMode != SQL_LOG_MODE_ALL) {
return;
// If no sqlLogMode is defined/available, choose SQL_LOG_MODE_ERROR
$sqlLogMode = $this->store->getVar(SYSTEM_SQL_LOG_MODE, STORE_SYSTEM);
if ($sqlLogMode === false) {
$sqlLogMode = SQL_LOG_MODE_ERROR;
}
break;
case SQL_LOG_MODE_MODIFY:
break;
case SQL_LOG_MODE_ERROR:
break;
default:
// Check if string is known.
foreach ([$sqlLogMode, $currentQueryMode] as $mode) {
if (!isset($this->sqlLogModePrio[$mode])) {
throw new UserFormException("Unknown SQL_LOG_MODE: $mode", ERROR_UNKNOWN_SQL_LOG_MODE);
}
}
// Log?
if ($this->sqlLogModePrio[$sqlLogMode] < ($this->sqlLogModePrio[$currentQueryMode])) {
return;
}
// Client IP Address
$remoteAddress = ($this->store === null) ? $this->store->getVar(CLIENT_REMOTE_ADDRESS, STORE_CLIENT) : '0.0.0.0';
......@@ -404,7 +409,7 @@ class Database {
}
if ($sql !== '') {
if ($mode == SQL_LOG_MODE_ERROR) {
if ($currentQueryMode == SQL_LOG_MODE_ERROR) {
$status = 'FAILED: ';
}
$msg .= '[' . $status . $sql . ']';
......
......@@ -22,6 +22,10 @@ class Logger {
*/
public static function logMessage($msg, $filename) {
if ($filename == '') {
return;
}
if (!$handle = fopen($filename, 'a')) {
throw new UserFormException("Error - cannot open. File: " . $filename . " ( CWD: " . getcwd() . ")", ERROR_IO_OPEN);
}
......
......@@ -107,6 +107,8 @@ class Report {
$this->showDebugInfoFlag = (Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_YES, $this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM)));
$this->checkUpdateSqlLog();
$this->pageDefaults[DEFAULT_QUESTION]["pagec"] = "Please confirm!:info";
$this->pageDefaults[DEFAULT_QUESTION]["paged"] = "Do you really want to delete the record?:warning";
......@@ -131,6 +133,26 @@ class Report {
}
/**
* If a variable 'sqlLog' is given in STORE_TYPO3 (=Bodytext) make them relative to SYSTEM_PATH_EXT and copy it to STORE_SYSTEM
*/
private function checkUpdateSqlLog() {
$sqlLog = $this->store->getVar(TYPO3_SQL_LOG, STORE_TYPO3);
if (false !== $sqlLog) {
if ($sqlLog != '' && $sqlLog[0] !== '/') {
$sqlLog = $this->store->getVar(SYSTEM_PATH_EXT, STORE_SYSTEM) . '/' . $sqlLog;
}
$this->store->setVar(SYSTEM_SQL_LOG, $sqlLog, STORE_SYSTEM);
}
$sqlLogMode = $this->store->getVar(TYPO3_SQL_LOG_MODE, STORE_TYPO3);
if (false !== $sqlLogMode) {
$this->store->setVar(SYSTEM_SQL_LOG_MODE, $sqlLogMode, STORE_SYSTEM);
}
}
/**
* Main function. Parses bodytext and iterates over all queries.
*
......
......@@ -101,6 +101,8 @@ class Config {
// Defaults
Support::setIfNotSet($config, SYSTEM_DATE_FORMAT, 'yyyy-mm-dd');
Support::setIfNotSet($config, SYSTEM_SHOW_DEBUG_INFO, SYSTEM_SHOW_DEBUG_INFO_AUTO);
Support::setIfNotSet($config, SYSTEM_SQL_LOG, SYSTEM_SQL_LOG_FILE);
Support::setIfNotSet($config, SYSTEM_SQL_LOG_MODE, SQL_LOG_MODE_NONE, ''); // do not worry: parse_ini_file() will replace 'none' and 'off' by ''. Set it here again.
Support::setIfNotSet($config, F_BS_COLUMNS, '12');
Support::setIfNotSet($config, F_BS_LABEL_COLUMNS, '3');
Support::setIfNotSet($config, F_BS_INPUT_COLUMNS, '6');
......
......@@ -240,7 +240,7 @@ class Store {
$config[SYSTEM_SHOW_DEBUG_INFO] = self::adjustConfigShowDebugInfo($config[SYSTEM_SHOW_DEBUG_INFO], self::beUserLoggdIn());
// make SQL PATH absolute. This is necessary to work in different directories correctly.
if (isset($config[SYSTEM_SQL_LOG]) && $config[SYSTEM_SQL_LOG][0] !== '/') {
if (!empty($config[SYSTEM_SQL_LOG]) && $config[SYSTEM_SQL_LOG][0] !== '/') {
$config[SYSTEM_SQL_LOG] = $config[SYSTEM_PATH_EXT] . '/' . $config[SYSTEM_SQL_LOG];
}
......
......@@ -6,7 +6,7 @@
require_once(__DIR__ . '/AbstractDatabaseTest.php');
require_once(__DIR__ . '/../../qfq/report/Report.php');
require_once(__DIR__ . '/../../qfq/store/Store.php');
//require_once(__DIR__ . '/../../qfq/store/Store.php'); // Should be included in the parent class AbstractDatabaseTest
require_once(__DIR__ . '/../../qfq/Evaluate.php');
require_once(__DIR__ . '/../../qfq/store/Session.php');
......@@ -957,7 +957,6 @@ EOF;
$this->assertEquals("normaltext{{10.unknown}}", $result);
}
/**
*
*/
......
Markdown is supported
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