You are here

function webform_uninstall in Webform 5.2

Same name and namespace in other branches
  1. 8.5 webform.install \webform_uninstall()
  2. 5 webform.install \webform_uninstall()
  3. 6.3 webform.install \webform_uninstall()
  4. 6.2 webform.install \webform_uninstall()
  5. 7.4 webform.install \webform_uninstall()
  6. 7.3 webform.install \webform_uninstall()
  7. 6.x webform.install \webform_uninstall()

Implementation of hook_uninstall().

File

./webform.install, line 156

Code

function webform_uninstall() {

  // Unset webform variables.
  variable_del('webform_use_cookies');
  variable_del('webform_debug');
  variable_del('webform_enable_fieldset');
  variable_del('webform_default_from_address');
  variable_del('webform_default_from_name');
  variable_del('webform_default_subject');
  variable_del('webform_csv_delimiter');
  $component_list = array();
  $path = drupal_get_path('module', 'webform') . '/components';
  $files = file_scan_directory($path, '^.*\\.inc$');
  foreach ($files as $filename => $file) {
    variable_del('webform_enable_' . $file->name, 1);
  }

  // Delete uploaded files.
  $filepath = file_create_path('webform');
  _webform_recursive_delete($filepath);

  // Drop tables.
  db_query("DROP TABLE {webform}");
  db_query("DROP TABLE {webform_component}");
  db_query("DROP TABLE {webform_roles}");
  db_query("DROP TABLE {webform_submissions}");
  db_query("DROP TABLE {webform_submitted_data}");
}