Skip to content

Commit

Permalink
DQA-9954: Improve regex pattern unsupported checks readonly comment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nbueneju authored Aug 12, 2024
1 parent 689b636 commit 9d299d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TaskRunner/Commands/ComponentCheckCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ private function disableConfigReadOnly()
if (file_exists($settings)) {
$content = file_get_contents($settings);
if (str_contains($content, 'config_readonly')) {
file_put_contents($settings, preg_replace('#(^\$settings\[["|\']config_readonly)#m', "//$1", $content));
file_put_contents($settings, preg_replace('#(^\s*\$settings\[["\']config_readonly["\']\])#m', "//$1", $content));
$this->disabledConfigReadonly = true;
}
}
Expand All @@ -1033,7 +1033,7 @@ private function restoreConfigReadOnly()
$config = $this->getConfig();
$settings = $config->get('drupal.root') . '/sites/' . $config->get('drupal.site.sites_subdir') . '/settings.php';
$content = file_get_contents($settings);
file_put_contents($settings, preg_replace('#^//(\$settings\[["|\']config_readonly)#m', "$1", $content));
file_put_contents($settings, preg_replace('#^//(\s*\$settings\[["\']config_readonly["\']\])#m', "$1", $content));
}

}

0 comments on commit 9d299d0

Please sign in to comment.