function search_api_acquia_set_version in Acquia Search for Search API 7.2
Same name and namespace in other branches
- 7 search_api_acquia.module \search_api_acquia_set_version()
Sets the version of this module in a system variable.
The version is used to construct the User Agent in requests to the backend. This allows Acquia to determine which module is being used to generate the search query which helps in debugging.
3 calls to search_api_acquia_set_version()
- search_api_acquia_cron in ./
search_api_acquia.module - Implements hook_cron().
- search_api_acquia_enable in ./
search_api_acquia.module - Implements hook_enable().
- search_api_acquia_requirements in ./
search_api_acquia.install - Implements hook_requirements().
File
- ./
search_api_acquia.module, line 493 - Provides integration between your Drupal site and Acquia's hosted search service via the Search API Solr module.
Code
function search_api_acquia_set_version() {
// Cache the version in a variable so we can send it at no extra cost.
$version = variable_get('search_api_acquia_version', '7.x');
$info = system_get_info('module', 'search_api_acquia');
// Send the version, or at least the core compatibility as a fallback.
$new_version = isset($info['version']) ? (string) $info['version'] : (string) $info['core'];
if ($version != $new_version) {
variable_set('search_api_acquia_version', $new_version);
}
}