I was dumbfounded today trying to setup a drupal 8 site on Aegir using the "config_installer" profile. This tool will automatically import the config from the CONFIG_SYNC_DIRECTORY.
I am trying to override the CONFIG_SYNC_DIRECTORY, which in aegir is written into settings.php as sites/DOMAIN.com/files/private/sync.
I tried using local.settings.php to change the sync directory as specified in https://www.drupal.org/docs/8/configuration-management/changing-the-stor...
It would not override the variable listed in the install profile.
I did a print and a die, and it did run, so I knew local.settings.php was being included.
Turns out, it was only being included ONCE. I don't know if it was Drupal 8 itself, or config_installer profile, but settings.php was being bootstrapped TWICE. Meaning, the second time it was NOT including local.settings.php, and was re-overriding my config.
When I changed it to just include, it worked as expected.
Comments
Comment #3
helmo commentedWhen setttings.php is being included twice this would hold for any config option. So updating the title.
D8 seems to have changed this to 'require' in core/lib/Drupal/Core/Site/Settings.php#n114
D7 has it in drupal_settings_initialize and does an include_once. And D6 does it the same way. So I'd vote to not change anything for those templates.
Comment #4
jon pughThanks for looking into this, Herman.
That makes sense. I'll revert the changes to the pre 8 templates.
Comment #5
jon pughNew branch pushed with a single commit for Drupal 8 template.
Comment #8
helmo commentedmerged, thanks.