- 🇧🇷Brazil Diego_Mow
Here i'm using config_split module to have specific environment configs, and added miniorange_saml to it.
That solves a lot of issues.
I think we can close this this one. - 🇬🇧United Kingdom therobyouknow
Drupal allows for config to be set in settings.php, so jwwj comment #2 will work, or variations of it: https://www.drupal.org/project/miniorange_saml/issues/3219912#comment-14... ✨ Store settings in environment instead of config to avoid git merges overwriting an environment's specific settings Active
Also, good to see an example of config_split provided by Diego_Mow. Though with jwwj's solution, it can be achieved without config_split.
So going with the jwwj approach (and that in https://www.drupal.org/project/miniorange_saml/issues/3219912#comment-14... ✨ Store settings in environment instead of config to avoid git merges overwriting an environment's specific settings Active ), the way I do it for generally storing platform specific config outside of the git source tree, is I would have a git-version controlled settings.php (with no environment specific settings, nor sensitive credentials, which references, via the
include
keyword, asettings.local.php
which is environment specific that contains the specific settings and credentials, including for the general drupal database. settings.local.php would be a symlink to a place outside of the git source tree. The symlink itself would be in the same subfolder as settings.php.web/sites/default/
:
settings.php
<-- git version controlled
settings.local.php
- a symlink e.g. ../../../../../../settings/1/settings.local.phpIn
settings.php
:/* settings.local.php (symlink) is in same folder as settings.php */ if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { include $app_root . '/' . $site_path . '/settings.local.php'; }
In
settings.local.php
(outside of git source), you would write the config as follows. Essentially it's writing the equivalent php nested array structure to reflect the series of labels and their indentations in yaml, so if your original yml config file looked like:config_item_a: config_item_b: config_item_c: config_item_d: 'value1, value2, value3'
then your equivalent php code in
settings.local.php
would look like:$config['config_item_a']['config_item_b']['config_item_c']['config_item_d'] = 'value1, value2, value3';
Further notes:
You could of course git ignore settings.local.php as a file in the source tree, but symlinking it out of there avoids accidental committing to the git source tree.The environment specific data and credentials could be set and referenced from the OS's i.e. Linux's own environment variables, as might imagine could be a common place practice for containerized environments.