]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/AutomaticInstallation.php
Merge pull request #6746 from nupplaphil/issue/6338-notices
[friendica.git] / src / Core / Console / AutomaticInstallation.php
index e6065dfb877d2a1cecc2eb6da2bc3311456c8c98..9d1e8506cc6887430ab8fae01517e109882e239a 100644 (file)
@@ -7,12 +7,8 @@ use Friendica\BaseObject;
 use Friendica\Core\Config;
 use Friendica\Core\Installer;
 use Friendica\Core\Theme;
-use Friendica\Database\DBA;
-use Friendica\Database\DBStructure;
 use RuntimeException;
 
-require_once 'include/dba.php';
-
 class AutomaticInstallation extends Console
 {
        protected function getHelp()
@@ -104,10 +100,10 @@ HELP;
                                }
                        }
 
-                       $db_host = $a->getConfigValue('database', 'hostname');
-                       $db_user = $a->getConfigValue('database', 'username');
-                       $db_pass = $a->getConfigValue('database', 'password');
-                       $db_data = $a->getConfigValue('database', 'database');
+                       $db_host = $a->getConfigCache()->get('database', 'hostname');
+                       $db_user = $a->getConfigCache()->get('database', 'username');
+                       $db_pass = $a->getConfigCache()->get('database', 'password');
+                       $db_data = $a->getConfigCache()->get('database', 'database');
                } else {
                        // Creating config file
                        $this->out("Creating config file...\n");
@@ -150,7 +146,7 @@ HELP;
 
                $installer->resetChecks();
 
-               if (!$installer->checkDB($db_host, $db_user, $db_pass, $db_data)) {
+               if (!$installer->checkDB($a->getBasePath(), $a->getConfigCache(), $a->getProfiler(), $db_host, $db_user, $db_pass, $db_data)) {
                        $errorMessage = $this->extractErrors($installer->getChecks());
                        throw new RuntimeException($errorMessage);
                }
@@ -162,7 +158,7 @@ HELP;
 
                $installer->resetChecks();
 
-               if (!$installer->installDatabase()) {
+               if (!$installer->installDatabase($a->getBasePath())) {
                        $errorMessage = $this->extractErrors($installer->getChecks());
                        throw new RuntimeException($errorMessage);
                }
@@ -187,6 +183,7 @@ HELP;
         * @param Installer $installer the Installer instance
         *
         * @return bool true if checks were successfully, otherwise false
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private function runBasicChecks(Installer $installer)
        {