You are here

commerce_amex.install in Commerce American Express Payment Gateway (Amex) 7

Ensures users have cURL enabled prior to installation.

File

commerce_amex.install
View source
<?php

/**
 * @file
 * Ensures users have cURL enabled prior to installation.
 */

/**
 * Implementation of hook_requirements().
 */
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;
}

Functions

Namesort descending Description
commerce_amex_requirements Implementation of hook_requirements().