From c504db5fd016222db13cd6493d95ecd94e3d1994 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 7 Feb 2018 20:04:02 -0200 Subject: Drupal: setup settings.local.php --- share/templater/drupal7/files/default.settings.php | 14 +++++++++++ share/templater/drupal7/files/settings.local.php | 1 + share/templater/drupal7/setup | 13 +++++++--- share/templater/drupal8/files/default.settings.php | 29 +++++++++++----------- share/templater/drupal8/files/settings.local.php | 1 + share/templater/drupal8/setup | 15 +++++++---- 6 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 share/templater/drupal7/files/settings.local.php create mode 100644 share/templater/drupal8/files/settings.local.php diff --git a/share/templater/drupal7/files/default.settings.php b/share/templater/drupal7/files/default.settings.php index a0b8a36..283c353 100644 --- a/share/templater/drupal7/files/default.settings.php +++ b/share/templater/drupal7/files/default.settings.php @@ -636,3 +636,17 @@ $databases['default']['default'] = array( 'host' => 'localhost', 'prefix' => '', ); + +/** + * Load local development override configuration, if available. + * + * Use settings.local.php to override variables on secondary (staging, + * development, etc) installations of this site. Typically used to disable + * caching, JavaScript/CSS compression, re-routing of outgoing emails, and + * other things that should not happen on development and testing sites. + * + * Keep this code block at the end of this file to take full effect. + */ +if (file_exists(__DIR__ . '/settings.local.php')) { + include __DIR__ . '/settings.local.php'; +} diff --git a/share/templater/drupal7/files/settings.local.php b/share/templater/drupal7/files/settings.local.php new file mode 100644 index 0000000..5f4746f --- /dev/null +++ b/share/templater/drupal7/files/settings.local.php @@ -0,0 +1 @@ +> .gitignore - echo settings.prod.php >> .gitignore - echo files >> .gitignore - echo sql >> .gitignore + echo settings.php >> .gitignore + echo settings.local.php >> .gitignore + echo settings.prod.php >> .gitignore + echo files >> .gitignore + echo sql >> .gitignore fi if [ ! -e "settings.dev.php" ]; then @@ -28,6 +29,10 @@ function templater_drupal7 { ln -sf settings.dev.php settings.php + if [ ! -e "settings.local.php" ]; then + cp $SHARE/drupal7/files/settings.local.php settings.local.php + fi + templater_install_makefile $SHARE/drupal7/files/Makefile.drupal7 if [ ! -e "drupal.make.yml" ]; then diff --git a/share/templater/drupal8/files/default.settings.php b/share/templater/drupal8/files/default.settings.php index bf3bd20..59afc6c 100644 --- a/share/templater/drupal8/files/default.settings.php +++ b/share/templater/drupal8/files/default.settings.php @@ -770,21 +770,6 @@ $settings['file_scan_ignore_directories'] = [ */ $settings['entity_update_batch_size'] = 50; -/** - * Load local development override configuration, if available. - * - * Use settings.local.php to override variables on secondary (staging, - * development, etc) installations of this site. Typically used to disable - * caching, JavaScript/CSS compression, re-routing of outgoing emails, and - * other things that should not happen on development and testing sites. - * - * Keep this code block at the end of this file to take full effect. - */ -# -# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { -# include $app_root . '/' . $site_path . '/settings.local.php'; -# } - /** * Basic config set by templater - https://templater.fluxo.info */ @@ -803,3 +788,17 @@ $config_directories['sync'] = 'sites/default/config/sync'; $settings['trusted_host_patterns'] = array( '^localhost$', ); + +/** + * Load local development override configuration, if available. + * + * Use settings.local.php to override variables on secondary (staging, + * development, etc) installations of this site. Typically used to disable + * caching, JavaScript/CSS compression, re-routing of outgoing emails, and + * other things that should not happen on development and testing sites. + * + * Keep this code block at the end of this file to take full effect. + */ +if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { + include $app_root . '/' . $site_path . '/settings.local.php'; +} diff --git a/share/templater/drupal8/files/settings.local.php b/share/templater/drupal8/files/settings.local.php new file mode 100644 index 0000000..5f4746f --- /dev/null +++ b/share/templater/drupal8/files/settings.local.php @@ -0,0 +1 @@ +> .gitignore - echo settings.prod.php >> .gitignore - echo services.yml >> .gitignore - echo files >> .gitignore - echo sql >> .gitignore + echo settings.php >> .gitignore + echo settings.local.php >> .gitignore + echo settings.prod.php >> .gitignore + echo services.yml >> .gitignore + echo files >> .gitignore + echo sql >> .gitignore fi if [ ! -e "settings.dev.php" ]; then @@ -29,6 +30,10 @@ function templater_drupal8 { ln -sf settings.dev.php settings.php + if [ ! -e "settings.local.php" ]; then + cp $SHARE/drupal7/files/settings.local.php settings.local.php + fi + if [ ! -e "services.yml" ]; then cp $SHARE/drupal8/files/default.services.yml services.dev.yml #cp $SHARE/drupal8/files/default.services.yml . -- cgit v1.2.3