Commit 75e02951 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'marc-test' into 'master'

Marc: hat Carsten getippt

See merge request !112
parents c79b8a2d c245bb8a
Pipeline #1114 passed with stage
in 1 minute and 40 seconds
......@@ -99,7 +99,7 @@ class Config {
# Read 'LocalConfiguration.php'
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY])) {
$configT3qfq = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY]);
$configT3qfq[SYSTEM_DB_NAME_T3] = $GLOBALS['TYPO3_CONF_VARS']['DB']['database'];
$configT3qfq[SYSTEM_DB_NAME_T3] = self::getDbName($GLOBALS['TYPO3_CONF_VARS']['DB']);
} else {
$all = include($pathTypo3Conf . '/' . CONFIG_T3);
......@@ -112,11 +112,13 @@ class Config {
throw new qfq\UserFormException ("Error read file: " . $pathTypo3Conf . '/' . CONFIG_T3, ERROR_IO_READ_FILE);
}
$configT3qfq[SYSTEM_DB_NAME_T3] = $all['DB']['database'];
$configT3qfq[SYSTEM_DB_NAME_T3] = self::getDbName($all['DB']);
unset($all);
}
$configIni = $pathTypo3Conf . '/' . CONFIG_QFQ_INI;
$configPhp = $pathTypo3Conf . '/' . CONFIG_QFQ_PHP;
}
// Migrate legacy config file.
......@@ -147,6 +149,18 @@ class Config {
return $config;
}
/**
* Returns T3 DB-Name, depending on T3 version
*
* @param array $db
* @return mixed
*/
private static function getDbName(array $db){
// T3 7.x: $GLOBALS['TYPO3_CONF_VARS']['DB']['database'], T3 8.x: $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']
return isset($db['database']) ? $db['database'] : $db['Connections']['Default']['dbname'];
}
/**
* Checks for deprecated options.
* @param array $config
......
......@@ -470,8 +470,8 @@ class Store {
*/
public static function setAutoConfigValue(array $config) {
$config[SYSTEM_DB_NAME_DATA] = $config['SYSTEM_DB_' . $config[SYSTEM_DB_INDEX_DATA] . '_NAME'] ?? '';
$config[SYSTEM_DB_NAME_QFQ] = $config['SYSTEM_DB_' . $config[SYSTEM_DB_INDEX_QFQ] . '_NAME'] ?? '';
$config[SYSTEM_DB_NAME_DATA] = $config['DB_' . $config[SYSTEM_DB_INDEX_DATA] . '_NAME'] ?? '';
$config[SYSTEM_DB_NAME_QFQ] = $config['DB_' . $config[SYSTEM_DB_INDEX_QFQ] . '_NAME'] ?? '';
return $config;
}
......
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