You are here

watchdog_filtering.install in Watchdog Filtering 7

Same filename and directory in other branches
  1. 6 watchdog_filtering.install

Install, update and uninstall functions for the watchdog_filtering module.

File

watchdog_filtering.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the watchdog_filtering module.
 */

/**
 * Implements hook_install().
 */
function watchdog_filtering_install() {
  $types = db_query('SELECT DISTINCT type FROM {watchdog}')
    ->fetchCol();
  foreach ($types as $type) {
    $type = rawurlencode($type);
    $severity = variable_get('watchdog_filtering_severity_' . $type);
    if ($severity === NULL) {
      variable_set('watchdog_filtering_severity_' . $type, FALSE);
    }
  }
}

/**
 * Implements hook_uninstall().
 */
function watchdog_filtering_uninstall() {
  global $conf;
  foreach ($conf as $key => $value) {
    if (strpos($key, 'watchdog_filtering_') === 0) {
      variable_del($key);
    }
  }
}

Functions