You are here

function taxonomy_import_uninstall in Taxonomy Import 8

Same name and namespace in other branches
  1. 2.x taxonomy_import.install \taxonomy_import_uninstall()

Implements hook_uninstall().

File

./taxonomy_import.install, line 11
Uninstall functions for the Taxonomy Import module.

Code

function taxonomy_import_uninstall() {

  // Delete file on uninstall.
  $files = db_query('SELECT file_managed.fid FROM file_managed WHERE uri LIKE :fid', [
    ':fid' => 'public://taxonomy_files/%',
  ]);
  foreach ($files as $val) {

    // Get location of the file.
    $location[] = $val->fid;
  }
  file_delete_multiple($location);

  // Remove directory on uninstall.
  rmdir('public://taxonomy_files/');
  drupal_flush_all_caches();
}