You are here

function addthis_uninstall in AddThis 6.3

Same name and namespace in other branches
  1. 6.2 addthis.install \addthis_uninstall()
  2. 7.4 addthis.install \addthis_uninstall()

Implements hook_uninstall().

File

./addthis.install, line 21
AddThis module installation/update hooks.

Code

function addthis_uninstall() {

  // Remove cached JavaScript file and cache directory.
  addthis_clear_js();
  $directory = file_directory_path() . '/addthis';
  @rmdir($directory);

  // Remove database artifacts left by the module.
  db_query('DELETE FROM {blocks} WHERE module = "addthis"');
  cache_clear_all('addthis:', 'cache', TRUE);

  // Remove module variables.
  $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'addthis_%'");
  while ($var_name = db_result($result)) {
    variable_del($var_name);
  }
}