You are here

function services_client_requirements in Services Client 7

Same name and namespace in other branches
  1. 7.2 services_client.install \services_client_requirements()

Implements hook_requirements().

File

./services_client.install, line 11
Installation file for services_client module.

Code

function services_client_requirements($phase) {
  $requirements = array();
  $t = get_t();

  // In case oauth_common is installed, skip the check.
  // Because oauth_common does this check already.
  if (!module_exists('oauth_common')) {
    $curl_available = function_exists('curl_init');
    $requirements['services_client_curl'] = array(
      'title' => $t('Services client'),
      'value' => $curl_available ? $t('cURL library Enabled') : $t('cURL library not found'),
    );
    if (!$curl_available) {
      $requirements['services_client_curl'] += array(
        'severity' => REQUIREMENT_ERROR,
        'description' => $t("ServicesClientConnectionCurlRequest requires the PHP <a href='!curl_url'>cURL</a> library.", array(
          '!curl_url' => 'http://php.net/manual/en/curl.setup.php',
        )),
      );
    }
  }
  return $requirements;
}