Skip to content

Commit acc368c

Browse files
authored
Merge pull request #31 from acquia/ACMS-3508
ACMS-3508: Update config.settings.php with drs override config dir.
2 parents 5c06103 + 4925e7d commit acc368c

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

settings/acquia-recommended.settings.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135

136136
foreach ($settings_files as $settings_file) {
137137
if (file_exists($settings_file)) {
138-
// phpcs:ignore
139-
require $settings_file;
138+
// phpcs:ignore
139+
require $settings_file;
140140
}
141141
}

settings/config.settings.php

+23-8
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,41 @@
1515
* directory should be shared between all multi-sites, and each multisite will
1616
* override this selectively using configuration splits. However, some
1717
* applications may prefer to manage the configuration for each multisite
18-
* completely separately. If this is the case, they can set
19-
* $drs_override_config_directories to FALSE and
20-
* $settings['config_sync_directory'] = $dir . "/config/$site_dir" in
18+
* completely separately. If this is the case,
19+
* set FALSE to $drs_override_config_directories
20+
* and $drs_override_site_studio_sync_directories
21+
* $settings['config_sync_directory'] = $dir . "/config/$site_dir"
22+
* $settings['site_studio_sync'] = $dir . "/sitestudio/$site_dir" in
2123
* settings.php, and we will not overwrite it.
2224
*/
23-
25+
// phpcs:ignore
26+
$drs_override_config_directories = $drs_override_config_directories ?? FALSE;
27+
$drs_override_site_studio_sync_directories = $drs_override_site_studio_sync_directories ?? FALSE;
2428

2529
/**
2630
* Site path.
2731
*
2832
* @var string $site_path
2933
* This is always set and exposed by the Drupal Kernel.
3034
*/
31-
// phpcs:ignore
32-
$site_name = EnvironmentDetector::getSiteName($site_path);
35+
// phpcs:ignore
36+
$site_name = EnvironmentDetector::getSiteName($site_path);
37+
3338
// phpcs:ignore
3439
// Config sync settings.
35-
$settings['config_sync_directory'] = "../config/" . $site_name;
40+
// if $settings['config_sync_directory'] isn't set by user the DRS
41+
// set to the ../config/$site_name and if $drs_override_config_directories
42+
// is TRUE then it sets to ../config/default.
43+
$config_settings = $settings['config_sync_directory'] ?? "../config/$site_name";
44+
$settings['config_sync_directory'] = !$drs_override_config_directories ? $config_settings : "../config/default";
45+
3646
// Site Studio sync settings.
37-
$settings['site_studio_sync'] = "../sitestudio/" . $site_name;
47+
// if $settings['site_studio_sync'] isn't set by user the DRS
48+
// set to the ../sitestudio/$site_name and if
49+
// $drs_override_site_studio_sync_directories is TRUE
50+
// then it sets to ../sitestudio/default.
51+
$site_studio_config_settings = $settings['site_studio_sync'] ?? "../sitestudio/$site_name";
52+
$settings['site_studio_sync'] = !$drs_override_site_studio_sync_directories ? $site_studio_config_settings : "../sitestudio/default";
3853

3954
$split_filename_prefix = 'config_split.config_split';
4055

0 commit comments

Comments
 (0)