devel.install 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * Implements hook_enable().
  4. */
  5. function devel_enable() {
  6. $t = get_t();
  7. // New module weights in core: put devel as the very last in the chain.
  8. db_update('system')
  9. ->fields(array(
  10. 'weight' => 88,
  11. ))
  12. ->condition('type', 'module')
  13. ->condition('name', 'devel')
  14. ->execute();
  15. // Create a custom menu, if Menu module is enabled.
  16. // @see devel_modules_installed()
  17. if (module_exists('menu')) {
  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. // Delete the development menu.
  42. if (module_exists('menu')) {
  43. if ($devel_menu = menu_load('devel')) {
  44. menu_delete($devel_menu);
  45. }
  46. }
  47. }
  48. /**
  49. * Remove feature for storing queries. Cleanup deprecated tables and variables.
  50. */
  51. function devel_update_7000() {
  52. db_drop_table('devel_queries');
  53. db_drop_table('devel_times');
  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. * Remove deprecated variables - dev_query, devel_code_coverage
  67. */
  68. function devel_update_7002() {
  69. variable_del('dev_query'); // Sad trombone. http://drupalcode.org/viewvc/drupal/drupal/includes/database.mysql.inc?revision=1.2&view=markup
  70. variable_del('devel_code_coverage');
  71. }
  72. /**
  73. * As per issue #813132: change schablon.com to white for krumo.
  74. */
  75. function devel_update_7003() {
  76. if (variable_get('devel_krumo_skin', 'white') == 'schablon.com') {
  77. variable_set('devel_krumo_skin', 'white');
  78. }
  79. }