Commit 94098f7e authored by drumm's avatar drumm

#81033 by webchick and neclimdul. Uninstall module API.

parent f96e4845
......@@ -350,6 +350,18 @@ function drupal_install_module($module) {
}
}
/**
* Calls the uninstall function and updates the system table for a given module.
*
* @param $module
* The module to uninstall.
*/
function drupal_uninstall_module($module) {
module_load_install($module);
module_invoke($module, 'uninstall');
drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
}
/**
* Verify the state of the specified file.
*
......
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function aggregator_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -112,3 +115,18 @@ function aggregator_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function aggregator_uninstall() {
db_query('DROP TABLE {aggregator_category}');
db_query('DROP TABLE {aggregator_category_feed}');
db_query('DROP TABLE {aggregator_category_item}');
db_query('DROP TABLE {aggregator_feed}');
db_query('DROP TABLE {aggregator_item}');
variable_del('aggregator_allowed_html_tags');
variable_del('aggregator_summary_items');
variable_del('aggregator_clear');
variable_del('aggregator_category_selector');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function book_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -28,3 +31,10 @@ function book_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function book_uninstall() {
db_query('DROP TABLE {book}');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function contact_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -30,3 +33,13 @@ function contact_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function contact_uninstall() {
db_query('DROP TABLE {contact}');
variable_del('contact_default_status');
variable_del('contact_form_information');
variable_del('contact_hourly_threshold');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function drupal_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -52,3 +55,20 @@ function drupal_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function drupal_uninstall() {
db_query('DROP TABLE {client}');
db_query('DROP TABLE {client_system}');
variable_del('drupal_authentication_service');
variable_del('drupal_directory');
variable_del('drupal_register');
variable_del('drupal_server');
variable_del('drupal_system');
variable_del('drupal_statistics');
variable_del('drupal_client_service');
variable_del('drupal_default_da_server');
variable_del('drupal_default_da_server_only');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function forum_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -26,3 +29,18 @@ function forum_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function forum_uninstall() {
db_query('DROP TABLE {forum}');
db_query("DELETE FROM {node} WHERE type = 'forum'");
variable_del('forum_containers');
variable_del('forum_nav_vocabulary');
variable_del('forum_hot_topic');
variable_del('forum_per_page');
variable_del('forum_order');
variable_del('forum_block_num_0');
variable_del('forum_block_num_1');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function locale_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -69,3 +72,12 @@ function locale_install() {
}
db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
}
/**
* Implementation of hook_uninstall().
*/
function locale_uninstall() {
db_query('DROP TABLE {locales_meta}');
db_query('DROP TABLE {locales_source}');
db_query('DROP TABLE {locales_target}');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function poll_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -63,3 +66,12 @@ function poll_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function poll_uninstall() {
db_query('DROP TABLE {poll}');
db_query('DROP TABLE {poll_votes}');
db_query('DROP TABLE {poll_choices}');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function profile_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -63,3 +66,12 @@ function profile_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function profile_uninstall() {
db_query('DROP TABLE {profile_fields}');
db_query('DROP TABLE {profile_values}');
variable_del('profile_block_author_fields');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function search_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -58,3 +61,14 @@ function search_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function search_uninstall() {
db_query('DROP TABLE {search_dataset}');
db_query('DROP TABLE {search_index}');
db_query('DROP TABLE {search_total}');
variable_del('minimum_word_size');
variable_del('overlap_cjk');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function statistics_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......@@ -36,3 +39,17 @@ function statistics_install() {
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function statistics_uninstall() {
db_query('DROP TABLE {accesslog}');
variable_del('statistics_count_content_views');
variable_del('statistics_enable_access_log');
variable_del('statistics_flush_accesslog_timer');
variable_del('statistics_day_timestamp');
variable_del('statistics_block_top_day_num');
variable_del('statistics_block_top_all_num');
variable_del('statistics_block_top_last_num');
}
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function system_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment