function acquia_search_derived_key_salt in Acquia Search 6.3
Same name and namespace in other branches
- 6 acquia_search.module \acquia_search_derived_key_salt()
Returns the subscription's salt used to generate the derived key.
The salt is stored in a system variable so that this module can continue connecting to Acquia Search even when the subscription data is not available. The most common reason for subscription data being unavailable is a failed heartbeat connection to rpc.acquia.com.
Acquia Connector versions <= 7.x-2.7 pulled the derived key salt directly from the subscription data. In order to allow for seamless upgrades, this function checks whether the system variable exists and sets it with the data in the subscription if it doesn't.
Return value
string The derived key salt.
See also
http://drupal.org/node/1784114
1 call to acquia_search_derived_key_salt()
- _acquia_search_derived_key in ./
acquia_search.module - Get the derived key for the solr hmac using the information shared with acquia.com.
3 string references to 'acquia_search_derived_key_salt'
- acquia_search_acquia_subscription_status in ./
acquia_search.module - Implementation of hook_acquia_subscription_status().
- acquia_search_disable in ./
acquia_search.module - Implementation of hook_disable().
- acquia_search_uninstall in ./
acquia_search.install - Implementation of hook_uninstall().
File
- ./
acquia_search.module, line 339 - Integration between Acquia Drupal and Acquia's hosted solr search service.
Code
function acquia_search_derived_key_salt() {
$salt = variable_get('acquia_search_derived_key_salt', '');
if (!$salt) {
// If the variable doesn't exist, set it using the subscription data.
$subscription = acquia_agent_settings('acquia_subscription_data');
if (isset($subscription['derived_key_salt'])) {
variable_set('acquia_search_derived_key_salt', $subscription['derived_key_salt']);
$salt = $subscription['derived_key_salt'];
}
}
return $salt;
}