You are here

function domain_drush_validate_domain in Domain Access 8

Same name and namespace in other branches
  1. 7.3 domain.drush.inc \domain_drush_validate_domain()

Validates a domain.

Parameters

string $hostname: The domain name to validate for syntax and uniqueness.

Return value

array An array of errors encountered.

See also

domain_validate()

1 call to domain_drush_validate_domain()
drush_domain_add_validate in domain/domain.drush.inc
Validates the domain add command arguments.

File

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

Code

function domain_drush_validate_domain($hostname) {

  /** @var \Drupal\domain\DomainValidatorInterface $validator */
  $validator = \Drupal::service('domain.validator');
  return $validator
    ->validate($hostname);
}