function gathercontent_requirements in GatherContent 7
Same name and namespace in other branches
- 8 gathercontent.install \gathercontent_requirements()
- 8.3 gathercontent.install \gathercontent_requirements()
- 7.3 gathercontent.install \gathercontent_requirements()
- 7.2 gathercontent.install \gathercontent_requirements()
Implements hook_requirements().
File
- ./
gathercontent.install, line 10 - Install, uninstall, and update functions for the GatherContent module.
Code
function gathercontent_requirements($phase) {
$requirements = array();
$t = get_t();
// Check if cURL is installed on the server.
// The GatherContent API requires Digest HTTP authentication, which
// drupal_http_request() doesn't support yet
// (see https://drupal.org/node/289820).
$has_curl = function_exists('curl_init');
$requirements['curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = $t('GatherContent could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array(
'@curl_url' => 'http://php.net/manual/en/curl.setup.php',
));
}
return $requirements;
}