forked from a64f7bb4-7358-4778-9fbe-3b882c34cc1d/v1
32 lines
650 B
PHP
32 lines
650 B
PHP
<?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']);
|
|
}
|