X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFactory%2FDBFactory.php;h=b4f0c9e3c194eb11f664df918c3654a04e96f366;hb=49def0dc27285557e91d7f8cf4c4ff97bac1489c;hp=c1a7965013e84a14dff775c365a7d11e2f3a9a85;hpb=74edf9994fca81be56ea893a449add5e61357e25;p=friendica.git diff --git a/src/Factory/DBFactory.php b/src/Factory/DBFactory.php index c1a7965013..b4f0c9e3c1 100644 --- a/src/Factory/DBFactory.php +++ b/src/Factory/DBFactory.php @@ -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);