You are here

function google_appliance_update_6201 in Google Search Appliance 6.2

File

./google_appliance.install, line 94
Installation file for building tables for Google Integration

Code

function google_appliance_update_6201() {
  $ret = array();
  $conf = variable_init();
  $var_names = array(
    'google_debug' => 'google_appliance_debug',
    'google_appliance_client' => 'google_appliance_default_client',
    'google_appliance_collection' => 'google_appliance_default_collection',
  );
  foreach ($var_names as $old => $new) {
    if (array_key_exists($old, $conf)) {
      variable_set($new, $conf[$old]);
      variable_del($old);
      $ret[] = array(
        'success' => TRUE,
        'query' => "variable_set({$new})",
      );
      $ret[] = array(
        'success' => TRUE,
        'query' => "variable_del({$old})",
      );
    }
  }
  if (db_table_exists('cache_google')) {
    db_add_index($ret, 'cache_google', 'cid', array(
      'cid',
    ));
    db_rename_table($ret, 'cache_google', 'cache_google_appliance');
  }
  return $ret;
}