You are here

function honeypot_uninstall in Honeypot 7

Same name and namespace in other branches
  1. 8 honeypot.install \honeypot_uninstall()
  2. 6 honeypot.install \honeypot_uninstall()
  3. 2.0.x honeypot.install \honeypot_uninstall()

Implements hook_uninstall().

File

./honeypot.install, line 60
Install, update and uninstall functions for the Honeypot module.

Code

function honeypot_uninstall() {
  db_delete('variable')
    ->condition('name', db_like('honeypot_') . '%', 'LIKE')
    ->execute();
  $cache_tables = array(
    'variables',
    'cache_bootstrap',
  );
  foreach ($cache_tables as $table) {
    if (db_table_exists($table)) {
      cache_clear_all($table, 'cache');
    }
  }

  // Delete 'honeypot' directory from files directory.
  drupal_load('module', 'honeypot');
  file_unmanaged_delete_recursive(honeypot_file_default_scheme() . '://honeypot');
}