You are here

function commerce_amex_requirements in Commerce American Express Payment Gateway (Amex) 7

Implementation of hook_requirements().

File

./commerce_amex.install, line 11
Ensures users have cURL enabled prior to installation.

Code

function commerce_amex_requirements($phase) {

  // Skip the requirements check if SimpleTest is installed to avoid multiple
  // cURL rows.
  if (module_exists('simpletest')) {
    return;
  }
  $t = get_t();
  if (!function_exists('curl_init')) {
    $requirements['commerce_amex_curl'] = array(
      'title' => $t('cURL'),
      'value' => $t('Not found'),
      'severity' => REQUIREMENT_ERROR,
      'description' => $t("Amex Payment Gateway requires the PHP <a href='!curl_url'>cURL</a> library.", array(
        '!curl_url' => 'http://php.net/manual/en/curl.setup.php',
      )),
    );
  }
  return $requirements;
}