protected function DomainCommands::checkHttpResponse in Domain Access 8
Checks the domain response.
Parameters
\Drupal\domain\DomainInterface $domain: The domain to check.
bool $validate_url: True to validate this domain by performing a URL lookup; False to skip the checks.
Return value
bool True if the domain resolves properly, or we are not checking, False otherwise.
2 calls to DomainCommands::checkHttpResponse()
- DomainCommands::createDomain in domain/
src/ Commands/ DomainCommands.php - Helper function: check a domain is responsive and create it.
- DomainCommands::defaultDomain in domain/
src/ Commands/ DomainCommands.php - Sets the default domain.
File
- domain/
src/ Commands/ DomainCommands.php, line 1055
Class
- DomainCommands
- Drush commands for the domain module.
Namespace
Drupal\domain\CommandsCode
protected function checkHttpResponse(DomainInterface $domain, $validate_url = FALSE) {
// Ensure the url is rebuilt.
if ($validate_url) {
$code = $this
->checkDomain($domain);
// Some sort of success:
return $code >= 200 && $code <= 299;
}
// Not validating, return FALSE.
return FALSE;
}