commerce.install 650 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/**
 * @file
 * Contains install and update functions for Commerce.
 */

/**
 * Implements hook_requirements().
 */
function commerce_requirements($phase) {
  $requirements = [];
13
  if ($phase == 'install' || $phase == 'runtime') {
14
    if (!extension_loaded('bcmath')) {
15 16 17
      $requirements['commerce_bcmath'] = [
        'title' => t('BC Math'),
        'description' => t('Commerce requires the BC Math PHP extension.'),
18 19 20 21 22 23 24
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }

  return $requirements;
}
25 26 27 28 29 30 31

/**
 * Install the Token module.
 */
function commerce_update_8201() {
  \Drupal::service('module_installer')->install(['token']);
}