View source
<?php
function update_status_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {cache_update_status} (\n cid varchar(255) NOT NULL default '',\n data longblob,\n expire int(11) NOT NULL default '0',\n created int(11) NOT NULL default '0',\n PRIMARY KEY (cid)\n )");
break;
case 'pgsql':
db_query("CREATE TABLE {cache_update_status} (\n cid varchar(255) NOT NULL default '',\n data bytea,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n PRIMARY KEY (cid)\n )");
break;
}
}
function update_status_uninstall() {
$variables = array(
'update_status_settings',
'update_status_notify_emails',
'update_status_check_frequency',
'update_status_notification_threshold',
'update_status_last',
'update_status_fetch_url',
'update_status_check_disabled',
);
foreach ($variables as $variable) {
variable_del($variable);
}
db_query("DROP TABLE {cache_update_status}");
cache_clear_all();
}
function update_status_update_5200() {
$ret = array();
foreach (array(
'update_status_last',
'update_status',
) as $variable) {
variable_del($variable);
$ret[] = array(
'success' => TRUE,
'query' => "variable_del({$variable})",
);
}
return $ret;
}
function update_status_update_5201() {
$ret = array();
$error_threshold = variable_get('update_status_error_threshold', '');
if (!empty($error_threshold)) {
variable_set('update_status_notification_threshold', $error_threshold);
$ret[] = array(
'success' => TRUE,
'query' => "variable_set('update_status_notification_threshold', {$error_threshold})",
);
}
foreach (array(
'update_status_error_threshold',
'update_status_usage_stats',
) as $variable) {
variable_del($variable);
$ret[] = array(
'success' => TRUE,
'query' => "variable_del({$variable})",
);
}
cache_clear_all();
return $ret;
}
function update_status_update_5202() {
$ret = array();
cache_clear_all();
menu_rebuild();
return $ret;
}
function update_status_update_5203() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("CREATE TABLE {cache_update_status} (\n cid varchar(255) NOT NULL default '',\n data longblob,\n expire int(11) NOT NULL default '0',\n created int(11) NOT NULL default '0',\n PRIMARY KEY (cid)\n )");
break;
case 'pgsql':
$ret[] = update_sql("CREATE TABLE {cache_update_status} (\n cid varchar(255) NOT NULL default '',\n data bytea,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n PRIMARY KEY (cid)\n )");
break;
}
return $ret;
}