function advagg_uninstall in Advanced CSS/JS Aggregation 7
Same name and namespace in other branches
- 8.4 advagg.install \advagg_uninstall()
- 8.2 advagg.install \advagg_uninstall()
- 8.3 advagg.install \advagg_uninstall()
- 6 advagg.install \advagg_uninstall()
- 7.2 advagg.install \advagg_uninstall()
Implements hook_uninstall().
File
- ./
advagg.install, line 65 - 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');
// Remove files.
list($css_path, $js_path) = advagg_get_root_files_dir();
file_scan_directory($css_path, '/.*/', array(
'callback' => 'file_unmanaged_delete',
));
@unlink($css_path);
file_scan_directory($js_path, '/.*/', array(
'callback' => 'file_unmanaged_delete',
));
@unlink($js_path);
// Remove database tables.
cache_clear_all('*', 'cache_advagg', TRUE);
cache_clear_all('*', 'cache_advagg_files_data', TRUE);
cache_clear_all('*', 'cache_advagg_bundle_reuse', TRUE);
// Remove variables.
// TODO Please review the conversion of this statement to the D7 database API syntax.
/* db_query("DELETE FROM {variable} WHERE name LIKE 'cache_flush_cache_advagg%'") */
db_delete('variable')
->condition('name', 'advagg_%', 'LIKE')
->condition('name', 'cache_flush_cache_advagg%', 'LIKE')
->execute();
}