By default set CiviCRM database to be same as CMS database
authorWilliam Mortada <william@mortada.co.uk>
Wed, 11 Oct 2017 23:55:51 +0000 (00:55 +0100)
committerWilliam Mortada <william@mortada.co.uk>
Wed, 11 Oct 2017 23:55:51 +0000 (00:55 +0100)
install/index.php

index f23c6b4a60b564d23d6f94e031516ccec8971fa7..ebc282eea63069c0ca5f6f2cc36b3063edcf8d2d 100644 (file)
@@ -313,18 +313,10 @@ elseif ($installType == 'wordpress') {
   }
 }
 
-// Load civicrm database config
+// Load CiviCRM database config
 if (isset($_POST['mysql'])) {
   $databaseConfig = $_POST['mysql'];
 }
-else {
-  $databaseConfig = array(
-    "server" => "localhost",
-    "username" => "civicrm",
-    "password" => "",
-    "database" => "civicrm",
-  );
-}
 
 if ($installType == 'wordpress') {
   // Load WP database config
@@ -371,6 +363,16 @@ if ($installType == 'backdrop') {
   }
 }
 
+// By default set CiviCRM database to be same as CMS database
+if (!isset($databaseConfig)) {
+  if (($installType == 'drupal') && (isset($drupalConfig))) {
+    $databaseConfig = $drupalConfig;
+  }
+  if (($installType == 'backdrop') && (isset($backdropConfig))) {
+    $databaseConfig = $backdropConfig;
+  }
+}
+
 // Check requirements
 $req = new InstallRequirements();
 $req->check();