Enhance Readme.
[project/devel.git] / devel.install
CommitLineData
48a80c07 1<?php
83013f8f 2
5b73e5e4 3/**
4561c8ec 4 * Implements hook_enable().
48a80c07 5 */
5517dfc2 6function devel_enable() {
5f4fb284
DR
7 $t = get_t();
8
9d450e49 9 // New module weights in core: put devel as the very last in the chain.
e5c39c18 10 db_update('system')
11 ->fields(array(
12 'weight' => 88,
13 ))
5f4fb284 14 ->condition('type', 'module')
e5c39c18 15 ->condition('name', 'devel')
16 ->execute();
83013f8f 17
5f4fb284
DR
18 $menu = array(
19 'menu_name' => 'devel',
20 'title' => $t('Development'),
21 'description' => $t('Development link'),
22 );
23 menu_save($menu);
d422058c 24}
47fd09f8 25
f0bd27f3 26/**
4561c8ec 27 * Implements hook_uninstall().
d422058c 28 */
29function devel_uninstall() {
d422058c 30 variable_del('devel_form_weights');
d422058c 31 variable_del('devel_execution');
32 variable_del('dev_timer');
33 variable_del('devel_query_display');
34 variable_del('devel_redirect_page');
35 variable_del('devel_api_url');
36 variable_del('dev_mem');
37 variable_del('devel_error_handler');
74a6c4bb 38 variable_del('devel_switch_user_list_size');
39 variable_del('devel_switch_user_include_anon');
4561c8ec 40 variable_del('devel_switch_user_show_form');
83013f8f 41
5f4fb284
DR
42 // Delete the development menu.
43 $devel_menu = menu_load('devel');
44 menu_delete($devel_menu);
48a80c07
GH
45}
46
ca029ab6 47/**
5f4fb284
DR
48 * Remove feature for storing queries. Cleanup deprecated tables and variables.
49 */
5b73e5e4 50function devel_update_7000() {
de383e66 51 db_drop_table('devel_queries');
52 db_drop_table('devel_times');
5de9665a 53}
1705c3ee
DR
54
55/**
56 * Rebuild the menus since everything is defined by devel_menu().
57 */
58function devel_update_7001() {
9c9a88ce
DR
59 db_delete('menu_links')
60 ->condition('module', 'devel')
61 ->execute();
62 variable_set('menu_rebuild_needed', TRUE);
63 return t('Devel module menu links will be rebuilt.');
1705c3ee 64}
1b6f0f46 65
66/**
a33c361f 67 * Remove deprecated variables - dev_query, devel_code_coverage
1b6f0f46 68 */
69function devel_update_7002() {
70 variable_del('dev_query'); // Sad trombone. http://drupalcode.org/viewvc/drupal/drupal/includes/database.mysql.inc?revision=1.2&view=markup
a33c361f 71 variable_del('devel_code_coverage');
1b6f0f46 72}
1285e4c4 73
74/**
75 * As per issue #813132: change schablon.com to white for krumo.
76 */
77function devel_update_7003() {
78 if (variable_get('devel_krumo_skin', 'white') == 'schablon.com') {
79 variable_set('devel_krumo_skin', 'white');
80 }
81}