Skip to content

Commit

Permalink
OPENEUROPA-1149: Make included additional settings file configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergepavle committed Sep 27, 2018
1 parent 1dce656 commit dc10244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ drupal:
root: "build"
root_absolute: ~
base_url: "http://127.0.0.1:8888"
settings_local_file: 'settings.local.php'

# Basic Drupal site information.
site:
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/DrupalCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ public function settingsSetup(array $options = [
])
{
$settings_file = $options['root'].'/sites/default/settings.php';
$settings_local_file = $options['root'] . '/sites/default/settings.local.php';
$settings_local_file = $options['root'] . '/sites/default/' . $this->getConfig()->get('drupal.settings_local_file');
return $this->collectionBuilder()->addTaskList([
$this->taskFilesystemStack()->copy($options['root'] . '/sites/default/default.settings.php', $settings_file),
$this->taskWriteToFile($settings_file)->append()->lines([
'if (file_exists($app_root . \'/\' . $site_path . \'/settings.local.php\')) {',
' include $app_root . \'/\' . $site_path . \'/settings.local.php\';',
'if (file_exists($app_root . \'/\' . $site_path . \'/' . $settings_local_file . '\')) {',
' include $app_root . \'/\' . $site_path . \'/' . $settings_local_file . '\';',
'}'
]),
$this->taskWriteToFile($settings_local_file)->lines([
Expand Down

0 comments on commit dc10244

Please sign in to comment.