You are here

function js_injector_uninstall in JS injector 7

Same name and namespace in other branches
  1. 8 js_injector.install \js_injector_uninstall()
  2. 6.2 js_injector.install \js_injector_uninstall()
  3. 6 js_injector.install \js_injector_uninstall()
  4. 7.2 js_injector.install \js_injector_uninstall()

Implements hook_uninstall().

File

./js_injector.install, line 61
Install, update and uninstall functions for the js_injector module.

Code

function js_injector_uninstall() {
  cache_clear_all('js_injector:*', 'cache', TRUE);
  $rules = db_query("SELECT * FROM {js_injector_rule}", array(), array(
    'fetch' => PDO::FETCH_ASSOC,
  ))
    ->fetchAllAssoc('crid');
  foreach ($rules as $id => $rule) {
    file_unmanaged_delete(_js_injector_rule_path($id));
  }
  db_drop_table('js_injector_rule');
}