2007-07-11 15:15:40 +00:00
<?php
// $Id$
2009-05-13 19:42:18 +00:00
/**
* @file
* Install, update and uninstall functions for the update module.
*/
2009-10-13 02:14:05 +00:00
/**
* Implement hook_install().
*/
function update_install() {
$queue = DrupalQueue::get('update_fetch_tasks');
$queue->createQueue();
}
2007-07-11 15:15:40 +00:00
/**
2009-05-27 18:34:03 +00:00
* Implement hook_uninstall().
2007-07-11 15:15:40 +00:00
*/
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',
2009-10-13 02:14:05 +00:00
'update_max_fetch_attempts',
'update_max_fetch_time',
2007-07-11 15:15:40 +00:00
);
foreach ($variables as $variable) {
variable_del($variable);
}
menu_rebuild();
2009-10-13 02:14:05 +00:00
$queue = DrupalQueue::get('update_fetch_tasks');
$queue->deleteQueue();
2007-07-11 15:15:40 +00:00
}
2007-10-05 14:43:26 +00:00
/**
2009-05-27 18:34:03 +00:00
* Implement hook_schema().
2007-10-05 14:43:26 +00:00
*/
function update_schema() {
$schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
2008-11-15 13:01:11 +00:00
$schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
2007-10-05 14:43:26 +00:00
return $schema;
}
2009-10-13 02:14:05 +00:00
/**
* 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();
}