You are here

function apachesolr_environment_variable_set in Apache Solr Search 6.3

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

Set a named variable, or return the default.

See also

variable_set()

9 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. @todo See if we can add info to the content type array for the cron_check
apachesolr_environment_save in ./apachesolr.module
Function that saves an 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().

... See full list

1 string reference to 'apachesolr_environment_variable_set'
drush_apachesolr_solr_variable_set in drush/apachesolr.drush.inc
Command callback. Set a variable.

File

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

Code

function apachesolr_environment_variable_set($env_id, $name, $value) {

  // @todo - fix this query since it's not standard SQL.
  // http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/variable_set/6
  $query = "INSERT INTO {apachesolr_environment_variable} (env_id, name, value)\n    VALUES ('%s','%s','%s')\n    ON DUPLICATE KEY UPDATE env_id = '%s', name = '%s', value = '%s'";
  db_query($query, array(
    $env_id,
    $name,
    serialize($value),
    $env_id,
    $name,
    serialize($value),
  ));
  apachesolr_environments_clear_cache();
}