You are here

function apachesolr_update_6304 in Apache Solr Search 6.3

Turn global variables in environment specific ones.

File

./apachesolr.install, line 381
Install and related hooks for apachesolr_search.

Code

function apachesolr_update_6304() {
  $stored = variable_get('apachesolr_index_last', array());
  foreach ($stored as $env_id => $entity_info) {
    apachesolr_environment_variable_set($env_id, 'apachesolr_index_last', $entity_info);
  }
  variable_del('apachesolr_index_last');
  $updated = variable_get('apachesolr_index_updated', array());
  $optimized = variable_get('apachesolr_last_optimize', 0);
  foreach ($updated as $env_id => $timestamp) {
    apachesolr_environment_variable_set($env_id, 'apachesolr_index_updated', $timestamp);
    apachesolr_environment_variable_set($env_id, 'apachesolr_last_optimize', $optimized);
  }
  variable_del('apachesolr_index_updated');
  variable_del('apachesolr_last_optimize');
}