forked from bartfeenstra/drupal-currency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurrency.install
35 lines (31 loc) · 922 Bytes
/
currency.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @file
* Contains installation, uninstallation, and update functionality.
*/
/**
* Implements hook_requirements().
*/
function currency_requirements($phase) {
$requirements = [];
// Do not use ::class constants, because we do not want to cause autoloading
// errors.
$classes = [
// A class belonging to commercie/currency.
'\Commercie\Currency\Currency',
// A class belonging to commercie/currency-exchange.
'\Commercie\CurrencyExchange\ExchangeRate',
];
foreach ($classes as $class) {
if (!class_exists($class)) {
$requirements['currency_composer'] = [
'description' => t('Currency requires Composer dependencies. Read the <a href="@url">documentation</a> on how to install them.', [
'@url' => 'https://www.drupal.org/node/2627292',
]),
'severity' => REQUIREMENT_ERROR,
];
break;
}
}
return $requirements;
}