Skip to content

Commit

Permalink
#369: have code to set environment indicator for ddev.
Browse files Browse the repository at this point in the history
  • Loading branch information
geekygnr committed Apr 29, 2024
1 parent c14854e commit 1d42221
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ScaffoldInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ private function installDdevCommand(): void
$fs = new Filesystem();
$fs->ensureDirectoryExists('./.ddev/commands/web');
$fs->copy($ddevCommandPath, './.ddev/commands/web/task');
if (file_exists('./web/sites/default/settings.php')) {
$settings = file_get_contents('./web/sites/default/settings.php');
if (strpos($settings, 'environment-indicator') === false) {
$include = <<<'EOT'
// See https://architecture.lullabot.com/adr/20210609-environment-indicator/
$config['environment_indicator.indicator']['name'] = 'Local';
$config['environment_indicator.indicator']['bg_color'] = '#505050';
$config['environment_indicator.indicator']['fg_color'] = '#ffffff';
EOT;
file_put_contents('./web/sites/default/settings.php', $include . PHP_EOL, FILE_APPEND);
}
}
}
}

Expand Down

0 comments on commit 1d42221

Please sign in to comment.