mirror of
https://github.com/friendica/friendica
synced 2025-04-25 04:30:11 +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
|
@ -11,13 +11,16 @@ class DBFactory
|
|||
/**
|
||||
* Initialize the DBA connection
|
||||
*
|
||||
* @param string $basePath The basepath of the application
|
||||
* @param Cache\IConfigCache $configCache The configuration cache
|
||||
* @param Profiler $profiler The profiler
|
||||
* @param array $server The $_SERVER variables
|
||||
* @param Profiler $profiler The profiler
|
||||
* @param array $server The $_SERVER variables
|
||||
*
|
||||
* @throws \Exception if connection went bad
|
||||
*
|
||||
* @todo refactor basedir during https://github.com/friendica/friendica/issues/6720
|
||||
*/
|
||||
public static function init(Cache\IConfigCache $configCache, Profiler $profiler, array $server)
|
||||
public static function init($basePath, Cache\IConfigCache $configCache, Profiler $profiler, array $server)
|
||||
{
|
||||
if (Database\DBA::connected()) {
|
||||
return;
|
||||
|
@ -48,9 +51,9 @@ class DBFactory
|
|||
$db_data = $server['MYSQL_DATABASE'];
|
||||
}
|
||||
|
||||
if (Database\DBA::connect($configCache, $profiler, $db_host, $db_user, $db_pass, $db_data, $charset)) {
|
||||
if (Database\DBA::connect($basePath, $configCache, $profiler, $db_host, $db_user, $db_pass, $db_data, $charset)) {
|
||||
// Loads DB_UPDATE_VERSION constant
|
||||
Database\DBStructure::definition($configCache->get('system', 'basepath'), false);
|
||||
Database\DBStructure::definition($basePath, false);
|
||||
}
|
||||
|
||||
unset($db_host, $db_user, $db_pass, $db_data, $charset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue