You are here

function drush_domain_test in Domain Access 7.3

Same name and namespace in other branches
  1. 8 domain/domain.drush.inc \drush_domain_test()

Test a domain record.

File

./domain.drush.inc, line 367
Drush commands for Domain Access.

Code

function drush_domain_test($argument = NULL) {
  if (is_null($argument)) {
    $domains = domain_domains();
  }
  else {
    if ($domain = drush_domain_get_from_argument($argument)) {
      $domains = array(
        $domain,
      );
    }
    else {
      return;
    }
  }
  foreach ($domains as $domain) {
    $error = domain_check_response($domain, TRUE);
    if ($error) {
      drush_print(dt('Fail: !error', array(
        '!error' => $error,
      )));
    }
    else {
      drush_print(dt('Success: !url tested successfully.', array(
        '!url' => domain_get_path($domain),
      )));
    }
  }
}