]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3995 the batch installer now skips the settings file creation step if settings...
authorCash Costello <cash.costello@gmail.com>
Sat, 22 Oct 2011 01:30:01 +0000 (21:30 -0400)
committerCash Costello <cash.costello@gmail.com>
Sat, 22 Oct 2011 01:30:01 +0000 (21:30 -0400)
install/ElggInstaller.php
install/cli/sample_installer.php

index 59ac44dc689389c881cf4afe4550b1af5a61f5ee..657f0907f95c72287a0c7636033abe97ce4d3e87 100644 (file)
@@ -39,6 +39,7 @@ class ElggInstaller {
                );
 
        protected $status = array(
+               'config' => FALSE,
                'database' => FALSE,
                'settings' => FALSE,
                'admin' => FALSE,
@@ -119,6 +120,9 @@ class ElggInstaller {
         * account. If it fails, an exception is thrown. It does not check any of
         * the requirements as the multiple step web installer does.
         *
+        * If the settings.php file exists, it will use that rather than the parameters
+        * passed to this function.
+        *
         * @param array $params         Array of key value pairs
         * @param bool  $createHtaccess Should .htaccess be created
         *
@@ -169,15 +173,22 @@ class ElggInstaller {
                        }
                }
 
-               if (!$this->createSettingsFile($params)) {
-                       throw new InstallationException(elgg_echo('install:error:settings'));
+               $this->setInstallStatus();
+
+               if (!$this->status['config']) {
+                       if (!$this->createSettingsFile($params)) {
+                               throw new InstallationException(elgg_echo('install:error:settings'));
+                       }
                }
 
                if (!$this->connectToDatabase()) {
                        throw new InstallationException(elgg_echo('install:error:databasesettings'));
                }
-               if (!$this->installDatabase()) {
-                       throw new InstallationException(elgg_echo('install:error:cannotloadtables'));
+
+               if (!$this->status['database']) {
+                       if (!$this->installDatabase()) {
+                               throw new InstallationException(elgg_echo('install:error:cannotloadtables'));
+                       }
                }
 
                // load remaining core libraries
@@ -597,6 +608,8 @@ class ElggInstaller {
 
                $this->loadSettingsFile();
 
+               $this->status['config'] = TRUE;
+
                // must be able to connect to database to jump install steps
                $dbSettingsPass = $this->checkDatabaseSettings(
                                $CONFIG->dbuser,
index 10838b562a04002e505559af4373cf8f5b491606..954169a6aae6e3a61f991c94cde3345ae6fc27ce 100644 (file)
@@ -15,6 +15,7 @@ $params = array(
 
        // site settings
        'sitename' => '',
+       'siteemail' => '',
        'wwwroot' => '',
        'dataroot' => '',