summaryrefslogtreecommitdiff
path: root/modules/update/update.install
blob: 7087cf65b004d3a103a3733b6ead2ddbef8a9586 (plain)
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
<?php
// $Id$

/**
 * @file
 * Install, update and uninstall functions for the update module.
 */

/**
 * Implement hook_install().
 */
function update_install() {
  $queue = DrupalQueue::get('update_fetch_tasks');
  $queue->createQueue();
}

/**
 * Implement hook_uninstall().
 */
function update_uninstall() {
  // Clear any variables that might be in use
  $variables = array(
    'update_check_frequency',
    'update_fetch_url',
    'update_last_check',
    'update_notification_threshold',
    'update_notify_emails',
    'update_max_fetch_attempts',
    'update_max_fetch_time',
  );
  foreach ($variables as $variable) {
    variable_del($variable);
  }
  menu_rebuild();
  $queue = DrupalQueue::get('update_fetch_tasks');
  $queue->deleteQueue();
}

/**
 * Implement hook_schema().
 */
function update_schema() {
  $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
  return $schema;
}

/**
 * Create a queue to store tasks for requests to fetch available update data. 
 */
function update_update_7000() {
  module_load_include('inc', 'system', 'system.queue');
  $queue = DrupalQueue::get('update_fetch_tasks');
  $queue->createQueue();
}