Skip to content

Commit

Permalink
ACMS-3622: Fix logic for local settings file.
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakmishra2 committed Mar 27, 2024
1 parent 34d4fe9 commit 696df8f
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Robo/Commands/Blt/MigrateToDrsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ private function updateSettingsFile(string $settingFile): void {
if (str_contains($fileContent, $this->bltConfigOverrideVar)) {
$fileContent = str_replace($this->bltConfigOverrideVar, $this->drsConfigOverrideVar, $fileContent);
}
// Check if blt use statement exists.
if (str_contains($fileContent, $this->bltUseStmt)) {
$fileContent = str_replace($this->bltUseStmt, $this->drsUseStmt, $fileContent);
}
// Let remove BLT require section from settings.php.
if (substr_count($fileContent, $this->drsSettingsWarning) < 1) {
$fileContent = str_replace($this->bltSettingsWarning, $this->drsSettingsWarning, $fileContent);
Expand All @@ -148,16 +152,4 @@ private function updateSettingsFile(string $settingFile): void {
file_put_contents($settingFile, $fileContent);
}

/**
* Update local settings file.
*
* @param string $localSettingsFile
* The local settings file path.
*/
private function updateLocalSettingsFile(string $localSettingsFile): void {
$fileContent = file_get_contents($localSettingsFile);
$updatedFileContent = str_replace($this->bltUseStmt, $this->drsUseStmt, $fileContent);
file_put_contents($localSettingsFile, $updatedFileContent);
}

}

0 comments on commit 696df8f

Please sign in to comment.