-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd8.install
More file actions
80 lines (68 loc) · 1.67 KB
/
Copy pathd8.install
File metadata and controls
80 lines (68 loc) · 1.67 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* @file
* Install, update, and uninstall functions for the d8 installation profile.
*/
use Drupal\d8\D8Setup;
use Drupal\d8\Form\D8CaptchaForm;
use Drupal\d8\Form\D8ConfigureForm;
/**
* Implements hook_install().
*/
function d8_install(bool $is_syncing): void {
if (!$is_syncing) {
\Drupal::classResolver(D8Setup::class)->install();
}
}
/**
* Implements hook_install_tasks().
*/
function d8_install_tasks(array &$install_state): array {
return [
'install_captcha_form' => [
'display_name' => t('Activate captcha'),
'type' => 'form',
'function' => D8CaptchaForm::class,
],
];
}
/**
* Implements hook_install_tasks_alter().
*/
function d8_install_tasks_alter(array &$tasks, array $install_state): void {
$tasks['install_configure_form']['function'] = D8ConfigureForm::class;
}
/**
* Implements hook_update_last_removed().
*/
function d8_update_last_removed(): int {
return 11201;
}
/**
* Install Persistent Login module.
*/
function d8_update_11301(array &$sandbox): void {
\Drupal::classResolver(D8Setup::class)->module('d8_login');
}
/**
* Install Ultimate Cron Summary module.
*/
function d8_update_11302(array &$sandbox): void {
\Drupal::classResolver(D8Setup::class)->module('ultimate_cron_summary');
}
/**
* Processes the list of update hooks.
*
* @param int[] ...
* The update hook identifiers.
*/
function _d8_update(): void {
$item = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0];
if (preg_match('#([^/]+)\.install$#', $item['file'], $matches)) {
$sandbox = [];
foreach (func_get_args() as $number) {
$function = "$matches[1]_update_$number";
$function($sandbox);
}
}
}