forked from acquia/acquia_lift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacquia_lift.install
40 lines (33 loc) · 1.46 KB
/
acquia_lift.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
36
37
38
39
40
<?php
use Drupal\acquia_lift\Service\Helper\SettingsHelper;
use Drupal\Core\Url;
/**
* Implements hook_requirements().
*/
function acquia_lift_requirements($phase) {
$requirements = [];
if ($phase !== 'runtime') {
return $requirements;
}
$credentialSettings = \Drupal::config('acquia_lift.settings')->get('credential');
if (!SettingsHelper::isInvalidCredential($credentialSettings)) {
return $requirements;
}
$requirements['acquia_lift_credential'] = [
'title' => t('Acquia Lift module'),
'description' => t('Acquia Lift module has not been fully configured yet. Please configure its settings from the <a href=":url">Acquia Lift Settings page</a>.', [':url' => Url::fromRoute('acquia_lift.admin_settings_form')->toString()]),
'severity' => REQUIREMENT_WARNING,
'value' => t('Incomplete or invalid credential'),
];
$args = [':upgrade' => 'https://docs.acquia.com/personalization/migration/#switching-to-personalization-4'];
$msg = (strtotime('1 October 2021') > time()) ?
t('Acquia Lift 3.x version will reach EOL at 2021-10-01. <a href=":upgrade">Upgrade</a> to 8.x-4.x or newer.', $args) :
t('Acquia Lift 3.x version reached EOL at 2021-10-01. <a href=":upgrade">Upgrade</a> to 8.x-4.x or newer.', $args);
$requirements['acquia_lift_eol'] = [
'title' => t('Acquia Lift module'),
'value' => t('The 8.x-3.x version is deprecated!'),
'description' => $msg,
'severity' => REQUIREMENT_WARNING,
];
return $requirements;
}