You are here

function apachesolr_environment_variable_set in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_environment_variable_set()
  2. 6.3 apachesolr.module \apachesolr_environment_variable_set()

Set a named variable, or return the default.

See also

variable_set()

10 calls to apachesolr_environment_variable_set()
apachesolr_clear_last_index_position in ./apachesolr.module
Clear a specific environment, or clear all.
apachesolr_cron in ./apachesolr.module
Implements hook_cron(). Runs the indexing process on all writable environments or just a given environment.
apachesolr_search_bias_form_submit in ./apachesolr_search.admin.inc
apachesolr_search_facetapi_realm_settings_form_submit in ./apachesolr_search.module
Form submission handler for facetapi_realm_settings_form().
apachesolr_set_last_index_position in ./apachesolr.module
Sets last changed and last ID for an environment and entity type.

... See full list

3 string references to 'apachesolr_environment_variable_set'
apachesolr_update_7017 in ./apachesolr.install
Turn global variables in environment specific ones.
apachesolr_update_7018 in ./apachesolr.install
Migrate apachesolr_last_optimize into apachesolr_last_optimize_success
drush_apachesolr_solr_variable_set in drush/apachesolr.drush.inc
Command callback. Set a variable.

File

./apachesolr.module, line 1430
Integration with the Apache Solr search application.

Code

function apachesolr_environment_variable_set($env_id, $name, $value) {
  apachesolr_environment_save_to_database($env_id);
  db_merge('apachesolr_environment_variable')
    ->key(array(
    'env_id' => $env_id,
    'name' => $name,
  ))
    ->fields(array(
    'value' => serialize($value),
  ))
    ->execute();
  apachesolr_environments_clear_cache();
}