function ip2country_requirements in IP-based Determination of a Visitor's Country 6
Same name and namespace in other branches
- 7 ip2country.install \ip2country_requirements()
Implements hook_requirements().
File
- ./
ip2country.install, line 15 - Install, update, and uninstall functions for the ip2country module.
Code
function ip2country_requirements($phase) {
$t = get_t();
$has_curl = function_exists('curl_init');
$requirements['ip2country_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['ip2country_curl']['severity'] = REQUIREMENT_ERROR;
$requirements['ip2country_curl']['description'] = $t("ip2country requires the PHP <a href='!curl_url'>cURL</a> library.", array(
'!curl_url' => 'http://php.net/manual/en/curl.setup.php',
));
}
return $requirements;
}