You are here

commerce_paypal_wpp.install in Commerce PayPal 7

Same filename and directory in other branches
  1. 7.2 modules/wpp/commerce_paypal_wpp.install

Ensures users have cURL enabled prior to installation.

File

modules/wpp/commerce_paypal_wpp.install
View source
<?php

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

/**
 * Implementation of hook_requirements().
 */
function commerce_paypal_wpp_requirements($phase) {

  // Skip the requirements check if SimpleTest is installed to avoid multiple
  // cURL rows.
  if (module_exists('simpletest')) {
    return;
  }
  $t = get_t();
  $has_curl = function_exists('curl_init');
  $requirements['commerce_paypal_wpp_curl'] = array(
    'title' => $t('cURL'),
    'value' => $has_curl ? $t('Enabled') : $t('Not found'),
  );
  if (!$has_curl) {
    $requirements['commerce_paypal_wpp_curl'] += array(
      'severity' => REQUIREMENT_ERROR,
      '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;
}

Functions

Namesort descending Description
commerce_paypal_wpp_requirements Implementation of hook_requirements().