Skip to content

Commit

Permalink
ACMS-1890: Updating blt_override_config_directories to drs_override_c…
Browse files Browse the repository at this point in the history
…onfig_directories in settings file.
  • Loading branch information
apathak18 committed Jan 22, 2024
1 parent 5f85c17 commit 71139c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion settings/config.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
global $_acsf_site_name;
if (isset($_acsf_site_name)) {
$config["$split_filename_prefix.$_acsf_site_name"]['status'] = TRUE;
}
}
8 changes: 6 additions & 2 deletions src/Robo/Commands/Blt/MigrateToDrsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,18 @@ private function processSettingsFile(string $site): void {
*/
private function updateSettingsFile(string $settingFile): void {
$fileContent = file_get_contents($settingFile);

// Let remove BLT require section from settings.php.
$settingsFileContent = str_replace($this->bltSettingsWarning, '', $fileContent);
if (substr_count($fileContent, $this->drsSettingsWarning) < 1) {
$settingsFileContent = str_replace($this->bltSettingsWarning, $this->drsSettingsWarning, $fileContent);
}
$bltConfigOverride = '$blt_override_config_directories';
// Check whether $blt_override_config_directories variable exists.
if (substr_count($settingsFileContent, $bltConfigOverride) < 1) {
$settingsFileContent = str_replace($bltConfigOverride, '$drs_override_config_directories', $settingsFileContent);
}

file_put_contents($settingFile, $fileContent);
file_put_contents($settingFile, $settingsFileContent);
}

/**
Expand Down

0 comments on commit 71139c4

Please sign in to comment.