Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Add additional settings file include options #2054 #2055

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions settings/blt.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@

// Store API Keys and things outside of version control.
// @see settings/sample-secrets.settings.php for sample code.
$secrets_file = sprintf('/mnt/gfs/%s.%s/secrets.settings.php', $_ENV['AH_SITE_GROUP'], $_ENV['AH_SITE_ENVIRONMENT']);
$secrets_file = sprintf("/mnt/gfs/%s.%s/secrets.settings.php", $_ENV['AH_SITE_GROUP'], $_ENV['AH_SITE_ENVIRONMENT']);
if (file_exists($secrets_file)) {
require $secrets_file;
}
// Includes secrets file for given site.
$site_secrets_file = sprintf("/mnt/gfs/%s.%s/$site_dir/secrets.settings.php", $_ENV['AH_SITE_GROUP'], $_ENV['AH_SITE_ENVIRONMENT']);
if (file_exists($site_secrets_file)) {
require $site_secrets_file;
}
}

/*******************************************************************************
Expand Down Expand Up @@ -177,6 +182,21 @@
$settings['deployment_identifier'] = file_get_contents($deploy_id_file);
}

/**
* Include custom global settings files.
*
* This is intended for to provide an opportunity for applications to override
* any previous configuration at a global or multisite level.
*
* This is being included before the CI and site specific files so all available
* settings are able to be overridden in the includes.settings.php file below.
*/
if ($settings_files = glob(DRUPAL_ROOT . "/sites/settings/*.settings.php")) {
foreach ($settings_files as $settings_file) {
require $settings_file;
}
}

/*******************************************************************************
* Environment-specific includes.
******************************************************************************/
Expand Down Expand Up @@ -229,7 +249,11 @@
* Keep this code block at the end of this file to take full effect.
*/
if ($is_local_env) {
// Load local machine settings.
// Load local settings for all sites.
if (file_exists(DRUPAL_ROOT . "/sites/settings/local.settings.php")) {
require DRUPAL_ROOT . "/sites/settings/local.settings.php";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably make sure this will not be added to deploy artifacts. Looks like these should handle it - https://github.com/acquia/blt/tree/8.x/scripts/blt/deploy

}
// Load local settings for given single.
if (file_exists(DRUPAL_ROOT . "/sites/$site_dir/settings/local.settings.php")) {
require DRUPAL_ROOT . "/sites/$site_dir/settings/local.settings.php";
}
Expand Down