Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLT-5200: Add an option to load settings prior Acquia Cloud settings #4648

Closed
vbouchet31 opened this issue Jan 19, 2023 · 0 comments · Fixed by #4649
Closed

BLT-5200: Add an option to load settings prior Acquia Cloud settings #4648

vbouchet31 opened this issue Jan 19, 2023 · 0 comments · Fixed by #4649
Labels
Enhancement A feature or feature request

Comments

@vbouchet31
Copy link
Contributor

In some cases (https://support-acquia.force.com/s/article/360049944713-How-to-override-the-default-MySQL-wait-timeout-setting for example), we need to place a setting before the Acquia Cloud settings are loaded.

On project using BLT, the good practice is to not change the sites/default/settings.php file generated by BLT and to use the files automatically loaded by blt.settings.php instead.

Following the good practice, it is currently not possible to do anything before Acquia Cloud settings are loaded

$settings_files = [];

[....]

// Acquia Cloud settings.
if (EnvironmentDetector::isAhEnv()) {
  try {
    if (!EnvironmentDetector::isAcsfEnv()) {
      // Pull in Acquia environment settings file. This eliminates the need to
      // add the Acquia require line in settings.php.
      $settings_files[] = FilePaths::ahSettingsFile(EnvironmentDetector::getAhGroup(), $site_name);
    }
  }
  catch (BltException $e) {
    trigger_error($e->getMessage(), E_USER_WARNING);
  }

  // Store API Keys and things outside of version control.
  // @see settings/sample-secrets.settings.php for sample code.
  // @see https://docs.acquia.com/resource/secrets/#secrets-settings-php-file
  $settings_files[] = EnvironmentDetector::getAhFilesRoot() . '/secrets.settings.php';
  $settings_files[] = EnvironmentDetector::getAhFilesRoot() . "/$site_name/secrets.settings.php";
}
@vbouchet31 vbouchet31 added the Enhancement A feature or feature request label Jan 19, 2023
@github-actions github-actions bot changed the title Add an option to load settings prior Acquia Cloud settings BLT-5200: Add an option to load settings prior Acquia Cloud settings Jan 19, 2023
danepowell added a commit that referenced this issue Jan 19, 2023
…#4649)

* Add inclusion of custom settings before acquia cloud settings.

* Update settings/blt.settings.php

Co-authored-by: Dane Powell <dane@danepowell.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants