| 1 |
<?php
|
| 2 |
// $Id: update_status.install,v 1.1.2.5 2007/08/14 07:24:49 dww Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_uninstall().
|
| 6 |
*/
|
| 7 |
function update_status_uninstall() {
|
| 8 |
$variables = array(
|
| 9 |
'update_status_settings',
|
| 10 |
'update_status_notify_emails',
|
| 11 |
'update_status_check_frequency',
|
| 12 |
'update_status_notification_threshold',
|
| 13 |
'update_status_last',
|
| 14 |
'update_status_fetch_url',
|
| 15 |
);
|
| 16 |
foreach ($variables as $variable) {
|
| 17 |
variable_del($variable);
|
| 18 |
}
|
| 19 |
cache_clear_all();
|
| 20 |
}
|
| 21 |
|
| 22 |
/**
|
| 23 |
* Remove the old data in stale variables used by the 5.x-1.* releases.
|
| 24 |
*/
|
| 25 |
function update_status_update_5200() {
|
| 26 |
$ret = array();
|
| 27 |
foreach (array('update_status_last', 'update_status') as $variable) {
|
| 28 |
variable_del($variable);
|
| 29 |
$ret[] = array('success' => TRUE, 'query' => "variable_del($variable)");
|
| 30 |
}
|
| 31 |
return $ret;
|
| 32 |
}
|
| 33 |
|
| 34 |
/**
|
| 35 |
* Database changes required for 5.x-2.0-rc2:
|
| 36 |
* - Rename and prune dead variables.
|
| 37 |
* - Clear menu cache.
|
| 38 |
*/
|
| 39 |
function update_status_update_5201() {
|
| 40 |
$ret = array();
|
| 41 |
$error_threshold = variable_get('update_status_error_threshold', '');
|
| 42 |
if (!empty($error_threshold)) {
|
| 43 |
variable_set('update_status_notification_threshold', $error_threshold);
|
| 44 |
$ret[] = array('success' => TRUE, 'query' => "variable_set('update_status_notification_threshold', $error_threshold)");
|
| 45 |
}
|
| 46 |
foreach (array('update_status_error_threshold', 'update_status_usage_stats') as $variable) {
|
| 47 |
variable_del($variable);
|
| 48 |
$ret[] = array('success' => TRUE, 'query' => "variable_del($variable)");
|
| 49 |
}
|
| 50 |
// Reset the menu cache since admin/logs/updates/check is a new path.
|
| 51 |
cache_clear_all();
|
| 52 |
return $ret;
|
| 53 |
}
|
| 54 |
|
| 55 |
/**
|
| 56 |
* More thorough attempt at rebuilding the menu cache, since
|
| 57 |
* admin/logs/updates/check is a new path.
|
| 58 |
*/
|
| 59 |
function update_status_update_5202() {
|
| 60 |
cache_clear_all();
|
| 61 |
menu_rebuild();
|
| 62 |
}
|