function w3c_validator_requirements in W3C Validator 6
Same name and namespace in other branches
- 7 w3c_validator.module \w3c_validator_requirements()
Implementation of hook_requirements().
File
- ./
w3c_validator.module, line 294 - W3C Validator proxy.
Code
function w3c_validator_requirements($phase) {
$requirements = array();
if ($phase == 'runtime' && variable_get('w3c_validator_method', 'w3c_markup_validator') == 'w3c_markup_validator') {
$endpoint = variable_get('w3c_validator_api_endpoint_uri', 'http://validator.w3.org/check');
$severity = REQUIREMENT_OK;
$description = '';
if ($endpoint == 'http://validator.w3.org/check') {
$severity = REQUIREMENT_ERROR;
$description = t('W3C Validator module is configured to use the official W3C validator API endpoint. You should <a href="!url">change the configuration</a> to point to your own instance of the validator, using the official endpoint intensively could be considered abuse of service. See the module documentation on how to install your own instance of the validator.', array(
'!url' => url('admin/settings/w3c_validator'),
));
}
else {
if (empty($endpoint)) {
$severity = REQUIREMENT_ERROR;
$description = t('W3C Validator module is not configured to use a proper API endpoint. You should <a href="!url">change the configuration</a> to point to your own instance of the validator, using the official endpoint intensively could be considered abuse of service. See the module documentation on how to install your own instance of the validator.', array(
'!url' => url('admin/settings/w3c_validator'),
));
}
}
$requirements['w3c_validator'] = array(
'title' => t('W3C Validator endpoint'),
'value' => $endpoint,
'description' => $description,
'severity' => $endpoint == 'http://validator.w3.org/check' ? REQUIREMENT_ERROR : (empty($endpoint) ? REQUIREMENT_WARNING : REQUIREMENT_OK),
);
}
return $requirements;
}