Same name in other branches
  1. 5.0.x advagg.install \advagg_uninstall()
  2. 6.0.x advagg.install \advagg_uninstall()
  3. 7.x-2.x advagg.install \advagg_uninstall()
  4. 8.x-2.x advagg.install \advagg_uninstall()
  5. 8.x-3.x advagg.install \advagg_uninstall()
  6. 8.x-4.x advagg.install \advagg_uninstall()

Implements hook_uninstall().

Fichier

./advagg.install, line 65

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