diff options
-rw-r--r-- | includes/install.inc | 12 | ||||
-rw-r--r-- | modules/aggregator/aggregator.install | 18 | ||||
-rw-r--r-- | modules/book/book.install | 10 | ||||
-rw-r--r-- | modules/contact/contact.install | 13 | ||||
-rw-r--r-- | modules/drupal/drupal.install | 20 | ||||
-rw-r--r-- | modules/forum/forum.install | 18 | ||||
-rw-r--r-- | modules/locale/locale.install | 12 | ||||
-rw-r--r-- | modules/poll/poll.install | 12 | ||||
-rw-r--r-- | modules/profile/profile.install | 12 | ||||
-rw-r--r-- | modules/search/search.install | 14 | ||||
-rw-r--r-- | modules/statistics/statistics.install | 17 | ||||
-rw-r--r-- | modules/system/system.install | 3 |
12 files changed, 161 insertions, 0 deletions
diff --git a/includes/install.inc b/includes/install.inc index 087d02577..9b19cf665 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -351,6 +351,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. * * @param $file diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install index 8a5d1612f..6c3220e4a 100644 --- a/modules/aggregator/aggregator.install +++ b/modules/aggregator/aggregator.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/book/book.install b/modules/book/book.install index 43406e0a3..1051d5325 100644 --- a/modules/book/book.install +++ b/modules/book/book.install @@ -1,6 +1,9 @@ <?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}'); +} diff --git a/modules/contact/contact.install b/modules/contact/contact.install index f7567a3de..0e3679d44 100644 --- a/modules/contact/contact.install +++ b/modules/contact/contact.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/drupal/drupal.install b/modules/drupal/drupal.install index f1c93d56c..909c539de 100644 --- a/modules/drupal/drupal.install +++ b/modules/drupal/drupal.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/forum/forum.install b/modules/forum/forum.install index 0d4815cb8..31ad02fa3 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/locale/locale.install b/modules/locale/locale.install index b818f1efa..e61449cd1 100644 --- a/modules/locale/locale.install +++ b/modules/locale/locale.install @@ -1,6 +1,9 @@ <?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}'); +} diff --git a/modules/poll/poll.install b/modules/poll/poll.install index d2863a731..733d71c65 100644 --- a/modules/poll/poll.install +++ b/modules/poll/poll.install @@ -1,6 +1,9 @@ <?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}'); +} diff --git a/modules/profile/profile.install b/modules/profile/profile.install index df1c85c7c..51237ed18 100644 --- a/modules/profile/profile.install +++ b/modules/profile/profile.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/search/search.install b/modules/search/search.install index 050ee704d..2b0391a3a 100644 --- a/modules/search/search.install +++ b/modules/search/search.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install index 8b5ed2be4..e1e2c00a4 100644 --- a/modules/statistics/statistics.install +++ b/modules/statistics/statistics.install @@ -1,6 +1,9 @@ <?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'); +} diff --git a/modules/system/system.install b/modules/system/system.install index 78f486b39..1f8607224 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1,6 +1,9 @@ <?php // $Id$ +/** + * Implementation of hook_install(). + */ function system_install() { switch ($GLOBALS['db_type']) { case 'mysql': |