From 19c6f50eca11cee5e10a4fe60d4caccbf74bda15 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 21 Sep 2016 22:09:38 -0400 Subject: [PATCH] Making doctor command more verbose for checking correct config. (#437) --- src/Drush/Command/BltDoctorCommand.php | 43 ++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/Drush/Command/BltDoctorCommand.php b/src/Drush/Command/BltDoctorCommand.php index b26bc2939..1f39d48fc 100644 --- a/src/Drush/Command/BltDoctorCommand.php +++ b/src/Drush/Command/BltDoctorCommand.php @@ -251,6 +251,9 @@ protected function checkUriResponse() { return FALSE; } + else { + drush_log("\$options['uri'] is set correctly.", 'success'); + } $site_available = drush_shell_exec("curl -I --insecure %s", $this->uri); if (!$site_available) { @@ -278,6 +281,9 @@ protected function checkHttps() { drush_print($this->statusTable['uri'], 2); drush_print(); } + else { + drush_log("The SSL certificate for your local site appears valid.", 'success'); + } } } @@ -484,6 +490,9 @@ protected function checkDevDesktopConfig() { drush_print("Add `export DEVDESKTOP_DRUPAL_SETTINGS_DIR=\"\$HOME/.acquia/DevDesktop/DrupalSettings\"` to ~/.bash_profile or equivalent for your system.`", 2); drush_print(); } + else { + drush_log("\$DEVDESKTOP_DRUPAL_SETTINGS_DIR is set.", 'success'); + } $variables_order = ini_get('variables_order'); $php_ini_file = php_ini_loaded_file(); @@ -492,6 +501,9 @@ protected function checkDevDesktopConfig() { drush_print("Define variables_order = \"EGPCS\" in $php_ini_file", 2); drush_print(); } + else { + drush_log("variables_order allows environment variables in php.ini.", 'success'); + } } } @@ -518,6 +530,9 @@ protected function checkBehatConfig() { return FALSE; } + else { + drush_log("Behat local settings file exists.", 'success'); + } $this->behatDefaultLocalConfig = Yaml::parse(file_get_contents($this->repoRoot . '/tests/behat/local.yml')); if ($this->drupalVmEnabled) { @@ -526,6 +541,9 @@ protected function checkBehatConfig() { drush_set_error("You have DrupalVM initialized, but drupal_root in tests/behat/local.yml does not reference the DrupalVM docroot."); drush_print(); } + else { + drush_log("Behat drupal_root is set correctly for Drupal VM.", 'success'); + } } $behat_base_url = $this->behatDefaultLocalConfig['local']['extensions']['Behat\MinkExtension']['base_url']; @@ -534,6 +552,9 @@ protected function checkBehatConfig() { drush_print("Set base_url to {$this->getUri()}", 2); drush_print(); } + else { + drush_log("Behat base_url matches drush URI.", 'success'); + } } @@ -555,6 +576,9 @@ protected function checkCiConfig() { drush_print("Add values for git.remotes to project.yml to enabled automated deployment.", 2); drush_print(); } + else { + drush_log("Git remotes are set in project.yml.", 'success'); + } } } @@ -568,14 +592,20 @@ protected function checkComposerConfig() { drush_print("This is necessary for BLT settings files to be available at runtime in production.", 2); drush_print(); } + else { + drush_log("acquia/blt is in composer.json's require object.", 'success'); + } $prestissimo_intalled = drush_shell_exec("composer global show | grep hirak/prestissimo"); if (!$prestissimo_intalled) { - drush_log("prestissimo plugin for composer is not installed.", 'warning'); + drush_log("hirak/prestissimo plugin for composer is not installed.", 'warning'); drush_print("Run `composer global require hirak/prestissimo:^0.3` to install it.", 2); drush_print("This will improve composer install/update performance by parallelizing the download of dependency information.", 2); drush_print(); } + else { + drush_log("hirak/prestissimo plugin for composer is installed.", 'success'); + } } protected function checkAcsfConfig() { @@ -587,6 +617,9 @@ protected function checkAcsfConfig() { drush_print("Add a require statement for \"/../vendor/acquia/blt/settings/blt.settings.php\" to $file_path", 2); drush_print(); } + else { + drush_log("BLT settings are included in your pre-settings-php include.", 'success'); + } } } @@ -628,7 +661,7 @@ protected function checkContribExists() { drush_print(); } else { - drush_log("Contributed module dependencies are present."); + drush_log("Contributed module dependencies are present.", 'success'); } } @@ -645,11 +678,17 @@ protected function checkProjectYml() { ]; $config = new Data($this->config); + $deprecated_keys_exist = FALSE; foreach ($deprecated_keys as $deprecated_key) { if ($config->get($deprecated_key)) { drush_log("The $deprecated_key key is deprecated. Please remove it from project.yml.", 'warning'); drush_print(); + $deprecated_keys_exist = TRUE; } } + + if (!$deprecated_keys_exist) { + drush_log("project.yml has no deprecated keys.", 'success'); + } } }