You are here

google_appliance.install in Google Search Appliance 7

Same filename and directory in other branches
  1. 5 google_appliance.install
  2. 6.2 google_appliance.install

install, update, and uninstall hooks

File

google_appliance.install
View source
<?php

/**
 * @file
 *    install, update, and uninstall hooks
 * @see google_appliance.module
 */

/**
 * Implements hook_uninstall().
 *   drop settings
 */
function google_appliance_uninstall() {
  $field_keys = array(
    'hostname',
    'collection',
    'frontend',
    'timeout',
    'autofilter',
    'language_filter_toggle',
    'language_filter_options',
    'query_inspection',
    'search_title',
    'results_per_page',
    'advanced_search_reporting',
    'spelling_suggestions',
    'onebox_modules',
    'block_visibility_settings',
    'sitelinks_search_box',
    'drupal_path',
    'error_gsa_no_results',
    'error_gsa_no_results_format',
    'error_curl_error',
    'error_curl_error_format',
    'error_lib_xml_parse_error',
    'error_lib_xml_parse_error_format',
  );
  foreach ($field_keys as $field) {
    variable_del('google_appliance_' . $field);
  }
}

/**
 * Clean up configurations unintentionally saved without a module namespace.
 */
function google_appliance_update_7100() {
  $bad_variables = array(
    'hostname',
    'collection',
    'frontend',
    'timeout',
    'autofilter',
    'language_filter_toggle',
    'language_filter_options',
    'query_inspection',
    'search_title',
    'results_per_page',
    'advanced_search_reporting',
    'spelling_suggestions',
    'onebox_modules',
    'block_visibility_settings',
    'drupal_path',
    'error_gsa_no_results',
    'error_gsa_no_results_format',
    'error_curl_error',
    'error_curl_error_format',
    'error_lib_xml_parse_error',
    'error_lib_xml_parse_error_format',
  );

  // Iterate through and delete all un-prefixed variables.
  foreach ($bad_variables as $variable) {
    variable_del($variable);
  }
}

Functions

Namesort descending Description
google_appliance_uninstall Implements hook_uninstall(). drop settings
google_appliance_update_7100 Clean up configurations unintentionally saved without a module namespace.