drupal/modules/update/update.install

57 lines
1.3 KiB
Plaintext

<?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();
}