Skip to content

Commit

Permalink
Making doctor command more verbose for checking correct config. (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Sep 22, 2016
1 parent f84b7f8 commit 19c6f50
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions src/Drush/Command/BltDoctorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
}
}
}

Expand Down Expand Up @@ -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();
Expand All @@ -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');
}
}
}

Expand All @@ -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) {
Expand All @@ -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'];
Expand All @@ -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');
}
}


Expand All @@ -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');
}
}
}

Expand All @@ -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() {
Expand All @@ -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');
}
}
}

Expand Down Expand Up @@ -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');
}
}

Expand All @@ -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');
}
}
}

0 comments on commit 19c6f50

Please sign in to comment.