From c6fba13b5bbc0f3ae97042322b1a1b641e67cd4a Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 19 Sep 2016 21:44:34 -0400 Subject: [PATCH] Adding check for blt.settings.php in factory hooks to doctor. (#428) --- src/Drush/Command/BltDoctorCommand.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Drush/Command/BltDoctorCommand.php b/src/Drush/Command/BltDoctorCommand.php index 7f2633dd4..b11f98c87 100644 --- a/src/Drush/Command/BltDoctorCommand.php +++ b/src/Drush/Command/BltDoctorCommand.php @@ -163,6 +163,7 @@ public function checkAll() { $this->checkComposerConfig(); $this->checkBehatConfig(); $this->checkProjectYml(); + $this->checkAcsfConfig(); // @todo Check error_level. // @todo Check if theme dependencies have been built. @@ -201,6 +202,9 @@ protected function checkSettingsFile() { drush_log("BLT settings are included in settings file:", 'success'); drush_print($settings_file_path, 2); } + else { + drush_set_error("BLT settings are not included in your settings file."); + } if (strstr($settings_file_contents, '/sites/default/settings/blt.settings.php')) { drush_set_error("Your settings file contains a deprecated statement for including BLT settings."); drush_print("Please remove the line containing \"/sites/default/settings/blt.settings.php\" in $settings_file_path.", 2); @@ -547,6 +551,17 @@ protected function checkComposerConfig() { } } + protected function checkAcsfConfig() { + $file_path = $this->repoRoot . '/factory-hooks/pre-settings-php/includes.php'; + if (file_exists($file_path)) { + $file_contents = file_get_contents($file_path); + if (!strstr($file_contents, '/../vendor/acquia/blt/settings/blt.settings.php')) { + drush_set_error("BLT settings are not included in your pre-settings-php include."); + drush_print("Add a require statement for \"/../vendor/acquia/blt/settings/blt.settings.php\" to $file_path", 2); + } + } + } + /** * Checks that caching is configured for local development. */