Bugfixings in Config

- replaced usage of "!<unset>!" with null-returns
- fixed bool settings (0/1)
- fixed overriding config-values
- fixed basepath problems
This commit is contained in:
Philipp Holzer 2019-02-22 23:51:13 +01:00
parent 2d91d5c3d9
commit 8c3aebc376
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
24 changed files with 175 additions and 157 deletions

View file

@ -40,6 +40,10 @@ class DBA
* @var Profiler
*/
private static $profiler;
/**
* @var string
*/
private static $basedir;
private static $server_info = '';
private static $connection;
private static $driver;
@ -55,13 +59,14 @@ class DBA
private static $db_name = '';
private static $db_charset = '';
public static function connect(IConfigCache $configCache, Profiler $profiler, $serveraddr, $user, $pass, $db, $charset = null)
public static function connect($basedir, IConfigCache $configCache, Profiler $profiler, $serveraddr, $user, $pass, $db, $charset = null)
{
if (!is_null(self::$connection) && self::connected()) {
return true;
}
// We are storing these values for being able to perform a reconnect
self::$basedir = $basedir;
self::$configCache = $configCache;
self::$profiler = $profiler;
self::$db_serveraddr = $serveraddr;
@ -1034,7 +1039,7 @@ class DBA
* This process must only be started once, since the value is cached.
*/
private static function buildRelationData() {
$definition = DBStructure::definition(self::$configCache->get('system', 'basepath'));
$definition = DBStructure::definition(self::$basedir);
foreach ($definition AS $table => $structure) {
foreach ($structure['fields'] AS $field => $field_struct) {