You are here

commerce.install in Commerce Core 8.2

Same filename and directory in other branches
  1. 7 commerce.install

Contains install and update functions for Commerce.

File

commerce.install
View source
<?php

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

/**
 * Implements hook_requirements().
 */
function commerce_requirements($phase) {
  $requirements = [];
  if ($phase == 'install' || $phase == 'runtime') {
    if (!extension_loaded('bcmath')) {
      $requirements['commerce_bcmath'] = [
        'title' => t('BC Math'),
        'description' => t('Commerce requires the BC Math PHP extension.'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}

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

Functions

Namesort descending Description
commerce_requirements Implements hook_requirements().
commerce_update_8201 Install the Token module.