]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/AutomaticInstallation.php
old behaviour restored
[friendica.git] / src / Core / Console / AutomaticInstallation.php
index e08491b805fd4c1fe3bb641bed14ddd403adf77d..189bb9d19e970739146f575ad19aa6a802834256 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\App;
 use Friendica\Core\Install;
 
 require_once 'mod/install.php';
+require_once 'include/dba.php';
 
 class AutomaticInstallation extends Console
 {
@@ -28,6 +29,7 @@ Options
     -h|--help|-? Show help information
     -v           Show more debug information.
     -a           All setup checks are required (except .htaccess)
+    -f           prepared config file (e.g. ".htconfig.php" itself)
 HELP;
        }
 
@@ -41,7 +43,11 @@ HELP;
                $db_user = '';
                $db_pass = '';
                $db_data = '';
-               require_once 'htconfig.php';
+
+               $config_file = $this->getOption('f', 'htconfig.php');
+
+               $this->out("Using config $config_file...\n");
+               require_once $config_file;
 
                Install::setInstallMode();
 
@@ -76,7 +82,7 @@ HELP;
                // Install database
                $this->out("Inserting data into database...\n");
 
-               $checkResults['data'] = Install::loadDatabase();
+               $checkResults['data'] = Install::installDatabaseStructure();
 
                if ($checkResults['data'] !== '') {
                        throw new \RuntimeException("ERROR: DB Database creation error. Is the DB empty?\n");
@@ -86,8 +92,8 @@ HELP;
 
                // Copy config file
                $this->out("Saving config file...\n");
-               if (!copy('htconfig.php', '.htconfig.php')) {
-                       throw new \RuntimeException("ERROR: Saving config file failed. Please copy .htautoinstall.php to .htconfig.php manually.\n");
+               if ($config_file != '.htconfig.php' && !copy($config_file, '.htconfig.php')) {
+                       throw new \RuntimeException("ERROR: Saving config file failed. Please copy '$config_file' to '.htconfig.php' manually.\n");
                }
                $this->out(" Complete!\n\n");
                $this->out("\nInstallation is finished\n");
@@ -104,7 +110,7 @@ HELP;
                $checks = [];
 
                Install::checkFunctions($checks);
-               Install::checkImagik($checks);
+               Install::checkImagick($checks);
                Install::checkHtConfig($checks);
                Install::checkSmarty3($checks);
                Install::checkKeys($checks);