mirror of
https://github.com/friendica/friendica
synced 2025-04-25 07:50:10 +00:00
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:
parent
2d91d5c3d9
commit
8c3aebc376
24 changed files with 175 additions and 157 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue