You are here

function devel_disable in Devel 6

Same name and namespace in other branches
  1. 5 devel.install \devel_disable()

Implementation of hook_disable().

File

./devel.install, line 90
Install file for devel module.

Code

function devel_disable() {

  // Query logging should probably not be set if devel.module is disabled.
  if (variable_get('dev_query', 0)) {
    variable_set('dev_query', 0);
    drupal_set_message(t('Disabled query logging since devel module is disabled.'));
  }

  // The SMTP server should also be restored, but only if it was set to devel
  // module or to the default sending method.
  $old_smtp = variable_get('devel_old_smtp_library', NULL);
  $current_smtp = variable_get('smtp_library', NULL);
  if (empty($current_smtp) || $current_smtp == drupal_get_filename('module', 'devel')) {
    if (empty($old_smtp)) {
      variable_del('smtp_library');
    }
    else {
      variable_set('smtp_library', $old_smtp);
    }
  }
  variable_del('devel_old_smtp_library');

  // Same for storing queries
  variable_del('devel_store_queries');

  // Disable Devel Block
  db_query("UPDATE {blocks} SET status = %d WHERE module = '%s' AND delta = '%s'", 0, 'menu', 'devel');
}