Implements hook_uninstall().

Fichier

./advagg.install, line 130

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);
}