From c3696b4b96431fd1481135207ba9847372c5e369 Mon Sep 17 00:00:00 2001 From: David Valdez Date: Thu, 18 Jul 2019 15:16:29 -0500 Subject: [PATCH] Add the configuration of the d7 database --- web/sites/default/settings.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/web/sites/default/settings.php b/web/sites/default/settings.php index 57b9c14..c695aa3 100644 --- a/web/sites/default/settings.php +++ b/web/sites/default/settings.php @@ -4,3 +4,27 @@ if (file_exists($app_root . '/' . $site_path . '/settings.ddev.php')) { include $app_root . '/' . $site_path . '/settings.ddev.php'; } +$host = "db"; +$port = 3306; + +// If DDEV_PHP_VERSION is not set, it means we're running on the host, +// so use the host-side bind port on docker IP +if (empty(getenv('DDEV_PHP_VERSION'))) { + $host = "127.0.0.1"; + $port = 32768; +} + +$databases['drupal7']['default'] = [ + 'database' => "drupal7", + 'username' => "db", + 'password' => "db", + 'host' => $host, + 'driver' => "mysql", + 'port' => $port, + 'prefix' => "", +]; + +// This specifies the default configuration sync directory. +if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) { + $config_directories[CONFIG_SYNC_DIRECTORY] = '../sync'; +}