You are here

function oauth_common_requirements in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 oauth_common.install \oauth_common_requirements()
  2. 7.4 oauth_common.install \oauth_common_requirements()

Implements hook_requirements().

File

./oauth_common.install, line 10
Installation and schema related functions for the OAuth module

Code

function oauth_common_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $curl_available = function_exists('curl_init');
  $requirements['oauth_common_curl'] = array(
    'title' => $t('OAuth'),
    'value' => $curl_available ? $t('cURL library Enabled') : $t('cURL library not found'),
  );
  if (!$curl_available) {
    $requirements['oauth_common_curl'] += array(
      'severity' => REQUIREMENT_ERROR,
      'description' => $t("DrupalOAuthClient requires the PHP <a href='!curl_url'>cURL</a> library.", array(
        '!curl_url' => 'http://php.net/manual/en/curl.setup.php',
      )),
    );
  }
  return $requirements;
}