-
Notifications
You must be signed in to change notification settings - Fork 5
/
backdrop_upgrade_status.install
64 lines (55 loc) · 1.74 KB
/
backdrop_upgrade_status.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @file
* Install, update, and uninstall functions for the Backdrop Upgrade Status module.
*/
/**
* Implements hook_install().
*/
function backdrop_upgrade_status_install() {
// Set upgrade checklist values.
variable_set('backdrop_upgrade_status_todo', array(1 => TRUE));
// Set default lifetime to one day.
variable_set('backdrop_upgrade_status_lifetime', 86400);
module_load_include('inc', 'system', 'system.queue');
$queue = DrupalQueue::get('backdrop_upgrade_status_fetch_tasks', TRUE);
$queue->createQueue();
}
/**
* Implements hook_uninstall().
*/
function backdrop_upgrade_status_uninstall() {
// Clean up our variables.
variable_del('backdrop_upgrade_status_last_check');
variable_del('backdrop_upgrade_status_lifetime');
variable_del('backdrop_upgrade_status_todo');
}
/**
* @addtogroup updates-7.x
* @{
*/
/**
* Create a queue to store tasks for requests to fetch available update data.
*/
function backdrop_upgrade_status_update_7000() {
module_load_include('inc', 'system', 'system.queue');
$queue = DrupalQueue::get('backdrop_upgrade_status_fetch_tasks', TRUE);
$queue->createQueue();
}
/**
* Create a queue to store tasks for requests to fetch available update data.
*/
function backdrop_upgrade_status_update_7001() {
$todo_status = variable_get('backdrop_upgrade_status_todo');
// Update machine names of todo items.
$todo_status['core_modules'] = $todo_status['core'];
unset($todo_status['core']);
$todo_status['contrib_modules'] = $todo_status['contrib'];
unset($todo_status['contrib']);
$todo_status['custom_modules'] = $todo_status['custom'];
unset($todo_status['custom']);
variable_set('backdrop_upgrade_status_todo', $todo_status);
}
/**
* @} End of "addtogroup updates-7.x".
*/