#1113940 by asimmonds: Fixed array warnings when generating content.
[project/devel.git] / devel.install
1 <?php
2
3 /**
4 * Implements hook_enable().
5 */
6 function devel_enable() {
7 $t = get_t();
8
9 // New module weights in core: put devel as the very last in the chain.
10 db_update('system')
11 ->fields(array(
12 'weight' => 88,
13 ))
14 ->condition('type', 'module')
15 ->condition('name', 'devel')
16 ->execute();
17
18 $menu = array(
19 'menu_name' => 'devel',
20 'title' => $t('Development'),
21 'description' => $t('Development link'),
22 );
23 menu_save($menu);
24 }
25
26 /**
27 * Implements hook_uninstall().
28 */
29 function devel_uninstall() {
30 variable_del('devel_form_weights');
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');
38 variable_del('devel_switch_user_list_size');
39 variable_del('devel_switch_user_include_anon');
40 variable_del('devel_switch_user_show_form');
41
42 // Delete the development menu.
43 $devel_menu = menu_load('devel');
44 menu_delete($devel_menu);
45 }
46
47 /**
48 * Remove feature for storing queries. Cleanup deprecated tables and variables.
49 */
50 function devel_update_7000() {
51 db_drop_table('devel_queries');
52 db_drop_table('devel_times');
53 }
54
55 /**
56 * Rebuild the menus since everything is defined by devel_menu().
57 */
58 function devel_update_7001() {
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.');
64 }
65
66 /**
67 * Remove deprecated variables - dev_query, devel_code_coverage
68 */
69 function 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
71 variable_del('devel_code_coverage');
72 }
73
74 /**
75 * As per issue #813132: change schablon.com to white for krumo.
76 */
77 function devel_update_7003() {
78 if (variable_get('devel_krumo_skin', 'white') == 'schablon.com') {
79 variable_set('devel_krumo_skin', 'white');
80 }
81 }