You are here

function commerce_braintree_requirements in Commerce Braintree 8

Same name and namespace in other branches
  1. 7.3 commerce_braintree.install \commerce_braintree_requirements()
  2. 7 commerce_braintree.install \commerce_braintree_requirements()
  3. 7.2 commerce_braintree.install \commerce_braintree_requirements()

Implements hook_requirements().

File

./commerce_braintree.install, line 11
Contains install and update functions for Commerce Braintree.

Code

function commerce_braintree_requirements($phase) {
  $requirements = [];
  if ($phase == 'install') {
    if (!class_exists('\\Braintree\\Gateway')) {
      $requirements['commerce_braintree_library'] = [
        'description' => t('Commerce Braintree requires the braintree/braintree_php library.'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}