Commit 913fd09a authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #5924: change include_once() against include() - second call to...

Bug #5924: change include_once() against include() - second call to include_once just returned 'true'.
parent 348fe3e2
......@@ -112,10 +112,10 @@ class Config {
}
try {
$config = include_once($configPhp);
$config = include($configPhp);
// in case $configIni doesn't exist: just skip
if ($config === false) {
if (!is_array($config)) {
$config = array();
}
} catch (\Exception $e) {
......@@ -150,7 +150,7 @@ class Config {
case SYSTEM_VAR_ADD_BY_SQL:
$msg = 'Replaced by: ' . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . '1|2|3';
}
throw new qfq\UserFormException ("Deprecated option in " . CONFIG_QFQ_INI . ": " . SYSTEM_VAR_ADD_BY_SQL . " - " . $msg);
throw new qfq\UserFormException ("Deprecated option in " . CONFIG_QFQ_PHP . ": " . SYSTEM_VAR_ADD_BY_SQL . " - " . $msg);
}
}
}
......
......@@ -82,8 +82,9 @@ class Store {
* @param string $bodytext
* @param string $fileConfigIni
*
* @throws CodeException
* @throws UserFormException
* @throws \qfq\CodeException
* @throws UserReportException
*/
private function __construct($bodytext = '', $fileConfigIni = '') {
......@@ -307,7 +308,7 @@ class Store {
foreach ($names as $name) {
if (!isset($config[$name])) {
throw new qfq\UserFormException ("Missing configuration in `" . CONFIG_QFQ_INI . "`: $name", ERROR_MISSING_CONFIG_INI_VALUE);
throw new qfq\UserFormException ("Missing configuration in `" . CONFIG_QFQ_PHP . "`: $name", ERROR_MISSING_CONFIG_INI_VALUE);
}
}
}
......@@ -540,8 +541,9 @@ class Store {
* @param string $fileConfigIni
*
* @return null|Store
* @throws CodeException
* @throws UserFormException
* @throws \qfq\CodeException
* @throws UserReportException
*/
public static function getInstance($bodytext = '', $phpUnit = false, $fileConfigIni = '') {
......@@ -850,6 +852,10 @@ class Store {
* Read SYSTEM_FILL_STORE_SYSTEM_BY_SQL_1|2|3 from SYSTEM_STORE and if set:
* a) fire the SQL
* b) merge all columns to STORE_SYSTEM
*
* @throws CodeException
* @throws DbException
* @throws UserFormException
*/
public static function StoreSystemUpdate() {
......@@ -866,7 +872,7 @@ class Store {
$db = new qfq\Database();
}
$errMsg = "More than 1 record found. " . CONFIG_QFQ_INI . ": " . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "$ii";
$errMsg = "More than 1 record found. " . CONFIG_QFQ_PHP . ": " . SYSTEM_FILL_STORE_SYSTEM_BY_SQL . "$ii";
$mode = ROW_EXPECT_0_1;
// If there is an error message defined, this means there should be exactly one record.
......@@ -894,6 +900,7 @@ class Store {
* @param $storeName
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public static function appendToStore($dataArray, $storeName) {
......
......@@ -82,7 +82,7 @@ abstract class AbstractDatabaseTest extends TestCase {
// $this->store->setVar('DB_1_NAME', $dbNamePhpUnit, STORE_SYSTEM);
$dbName = $this->store->getVar('DB_NAME_TEST', STORE_SYSTEM);
if ($dbName == '') {
throw new \qfq\CodeException('Missing DB_NAME_TEST in ' . CONFIG_QFQ_INI, ERROR_MISSING_REQUIRED_PARAMETER);
throw new \qfq\CodeException('Missing DB_NAME_TEST in ' . CONFIG_QFQ_PHP, ERROR_MISSING_REQUIRED_PARAMETER);
} else {
$this->store->setVar('DB_1_NAME', $dbName, STORE_SYSTEM);
}
......
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