You are here

function uc_paypal_requirements in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 payment/uc_paypal/uc_paypal.install \uc_paypal_requirements()

Implements hook_requirements().

File

payment/uc_paypal/uc_paypal.install, line 11
Install, update and uninstall functions for the uc_paypal module.

Code

function uc_paypal_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $has_curl = function_exists('curl_init');

  // PayPal WPP requires cURL.
  if (variable_get('uc_pg_paypal_wpp_enabled', TRUE)) {
    $requirements['uc_paypal_curl'] = array(
      'title' => $t('cURL'),
      'value' => $has_curl ? $t('Enabled') : $t('Not found'),
    );
    if (!$has_curl) {
      $requirements['uc_paypal_curl']['severity'] = REQUIREMENT_ERROR;
      $requirements['uc_paypal_curl']['description'] = $t("PayPal WPP requires the PHP <a href='!curl_url'>cURL</a> library.", array(
        '!curl_url' => 'http://php.net/manual/en/curl.setup.php',
      ));
    }
  }
  return $requirements;
}