update.install 1.28 KB
Newer Older
1
2
3
<?php
// $Id$

4
5
6
7
8
/**
 * @file
 * Install, update and uninstall functions for the update module.
 */

9
/**
10
 * Implements hook_install().
11
12
13
14
15
16
 */
function update_install() {
  $queue = DrupalQueue::get('update_fetch_tasks');
  $queue->createQueue();
}

17
/**
18
 * Implements hook_uninstall().
19
20
21
22
23
24
25
26
27
 */
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',
28
29
    'update_max_fetch_attempts',
    'update_max_fetch_time',
30
31
32
33
  );
  foreach ($variables as $variable) {
    variable_del($variable);
  }
34
35
  $queue = DrupalQueue::get('update_fetch_tasks');
  $queue->deleteQueue();
36
}
37
38

/**
39
 * Implements hook_schema().
40
41
42
 */
function update_schema() {
  $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
43
  $schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
44
45
  return $schema;
}
46
47

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