You are here

function commerce_avatax_requirements in Drupal Commerce Connector for AvaTax 7.4

Same name and namespace in other branches
  1. 7.5 commerce_avatax.install \commerce_avatax_requirements()
  2. 7.3 commerce_avatax.install \commerce_avatax_requirements()

Implements hook_requirements().

File

./commerce_avatax.install, line 40
Installation functions for Commerce AvaTax Connector.

Code

function commerce_avatax_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  $has_curl = extension_loaded('curl');
  $requirements['commerce_avatax_curl'] = array(
    'title' => $t('cURL'),
    'value' => $has_curl ? $t('Enabled for Commerce AvaTax') : $t('Not found'),
  );
  if (!$has_curl) {
    $requirements['commerce_avatax_curl']['severity'] = REQUIREMENT_ERROR;
    $requirements['commerce_avatax_curl']['description'] = $t('Commerce AvaTax requires PHP cURL extension to be enabled and configured on your server.');
  }
  return $requirements;
}