You are here

function advagg_uninstall in Advanced CSS/JS Aggregation 7.2

Same name and namespace in other branches
  1. 8.4 advagg.install \advagg_uninstall()
  2. 8.2 advagg.install \advagg_uninstall()
  3. 8.3 advagg.install \advagg_uninstall()
  4. 6 advagg.install \advagg_uninstall()
  5. 7 advagg.install \advagg_uninstall()

Implements hook_uninstall().

File

./advagg.install, line 130
Handles Advanced Aggregation installation and upgrade tasks.

Code

function advagg_uninstall() {

  // Make sure the advagg_get_root_files_dir() function is available.
  drupal_load('module', 'advagg');
  list($css_path, $js_path) = advagg_get_root_files_dir();

  // Make sure the advagg_flush_all_cache_bins() function is available.
  module_load_include('inc', 'advagg', 'advagg.cache');

  // Flush caches.
  advagg_flush_all_cache_bins();

  // Remove variables.
  db_delete('variable')
    ->condition('name', 'advagg%', 'LIKE')
    ->execute();

  // Remove all files and directories.
  file_unmanaged_delete_recursive($css_path[0]);
  file_unmanaged_delete_recursive($js_path[0]);

  // Make sure the theme_registry: cid is cleared.
  register_shutdown_function('cache_clear_all', 'theme_registry:', 'cache', TRUE);
}