]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/Database.php
Merge pull request #7414 from annando/fetch-diaspora
[friendica.git] / src / Database / Database.php
index cdd5a357ab1cb1c697318596712159bc3833cc7f..c503416912287fd22bfc5516c28c35e9c85fedbb 100644 (file)
@@ -46,7 +46,7 @@ class Database
        private $in_retrial     = false;
        private $relation       = [];
 
-       public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server)
+       public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server = [])
        {
                // We are storing these values for being able to perform a reconnect
                $this->configCache   = $configCache;
@@ -57,6 +57,11 @@ class Database
                $this->connect();
 
                DBA::init($this);
+
+               if ($this->isConnected()) {
+                       // Loads DB_UPDATE_VERSION constant
+                       DBStructure::definition($configCache->get('system', 'basepath'), false);
+               }
        }
 
        private function readServerVariables(array $server)