Merge pull request #19594 from eileenmcnaughton/535m
[civicrm-core.git] / setup / plugins / init / Drupal8.civi-setup.php
index 22034e90895400b5d3cb81cb4617ee90b35ede6c..f81b362a51ec1bf066db5bd2632149e1494f57fb 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('CIVI_SETUP')) {
 
     // Compute settingsPath.
     $siteDir = \Civi\Setup\DrupalUtil::getDrupalSiteDir($cmsPath);
-    $model->settingsPath = implode(DIRECTORY_SEPARATOR, [$cmsPath, 'sites', $siteDir, 'civicrm.settings.php']);
+    $model->settingsPath = implode(DIRECTORY_SEPARATOR, [$cmsPath, $siteDir, 'civicrm.settings.php']);
 
     if (($loadGenerated = \Drupal\Core\Site\Settings::get('civicrm_load_generated', NULL)) !== NULL) {
       $model->loadGenerated = $loadGenerated;
@@ -41,8 +41,9 @@ if (!defined('CIVI_SETUP')) {
     // Compute DSN.
     $connectionOptions = \Drupal::database()->getConnectionOptions();
     $ssl_params = \Civi\Setup\DrupalUtil::guessSslParams($connectionOptions);
+    // @todo Does Drupal support unixsocket in config? Set 'server' => 'unix(/path/to/socket.sock)'
     $model->db = $model->cmsDb = array(
-      'server' => \Civi\Setup\DbUtil::encodeHostPort($connectionOptions['host'], $connectionOptions['port'] ?: NULL),
+      'server' => \Civi\Setup\DbUtil::encodeHostPort($connectionOptions['host'], $connectionOptions['port'] ?? NULL),
       'username' => $connectionOptions['username'],
       'password' => $connectionOptions['password'],
       'database' => $connectionOptions['database'],