You are here

commerce_payleap.install in Commerce Payleap 7

Install, update, and uninstall functions for the commerce payleap module.

File

commerce_payleap.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the commerce payleap module.
 */

/**
 * Implementation of hook_requirements().
 *
 * Ensures users have cURL enabled prior to installation.
 */
function commerce_payleap_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_payleap_curl'] = array(
    'title' => $t('cURL'),
    'value' => $has_curl ? $t('Enabled') : $t('Not found'),
  );
  if (!$has_curl) {
    $requirements['commerce_payleap_curl'] += array(
      'severity' => REQUIREMENT_ERROR,
      'description' => $t("Payleap 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_payleap_requirements Implementation of hook_requirements().