Commit 84d6c020 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Constants.php, Store.php: path of config.ini adjusted if PHPUnit is running

parent baca303c
......@@ -7,7 +7,7 @@
*/
const EXT_KEY = 'qfq';
const CONFIG_INI = "../../config.qfq.ini"; // QFQ configuration file: db access
const CONFIG_INI = "config.qfq.ini"; // QFQ configuration file: db access
const GFX_INFO = 'typo3conf/ext/qfq/Resources/Public/icons/note.gif';
const API_DIR = 'typo3conf/ext/qfq/qfq/api';
......
......@@ -171,10 +171,23 @@ class Store {
* @throws qfq\UserFormException
*/
private static function fillSystemStore() {
// PHPUnit Path to CONFIG_INI
$configIni = __DIR__ . '/../../../' . CONFIG_INI;
if (!file_exists($configIni)) {
// Production Path to CONFIG_INI
$configIni = __DIR__ . '/../../../../../' . CONFIG_INI;
if (!file_exists($configIni)) {
throw new qfq\UserFormException ("Config not found: " . getcwd() . "/" . $configIni, ERROR_IO_READ_FILE);
}
}
try {
//TODO: Vernuenftige Fehlermeldung falls nicht auf qfq.ini zugegriffen werden kann.
//TODO: sinnvollen Platz fuer qfq.ini bestimmen. In der Installationsdoku erwaehnen.
$config = parse_ini_file(__DIR__ . '/../../../' . CONFIG_INI, false);
// $config = parse_ini_file(__DIR__ . '/../../../' . CONFIG_INI, false);
$config = parse_ini_file($configIni, false);
//TODO: auskommentiert weil dann die Unittests nicht mehr laufen. Sollte eigentlich wieder aktiviert werden.
// $config['SQLLOG'] = Support::ifRelativePathPrependExtensionPath($config['SQLLOG']);
......
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