function apachesolr_site_hash in Apache Solr Search 7
Same name and namespace in other branches
- 8 apachesolr.module \apachesolr_site_hash()
- 5.2 apachesolr.module \apachesolr_site_hash()
- 6.3 apachesolr.module \apachesolr_site_hash()
- 6 apachesolr.module \apachesolr_site_hash()
- 6.2 apachesolr.module \apachesolr_site_hash()
Like $site_key in _update_refresh() - returns a site-specific hash.
6 calls to apachesolr_site_hash()
- apachesolr_access_apachesolr_index_document_build_node in apachesolr_access/
apachesolr_access.module - Implements hook_apachesolr_index_document_build_node()
- apachesolr_access_build_subquery in apachesolr_access/
apachesolr_access.module - Creates a Solr query for a given user
- apachesolr_document_id in ./
apachesolr.module - Generate a unique ID for an entity being indexed.
- DrupalApacheSolrNodeAccess::testIndexing in apachesolr_access/
tests/ apachesolr_access.test - Tests indexing and check if it adds the correct grants for those specific users
- hook_apachesolr_delete_by_query_alter in ./
apachesolr.api.php - Allows a module to modify the delete query.
1 string reference to 'apachesolr_site_hash'
- apachesolr_uninstall in ./
apachesolr.install - Implements hook_uninstall().
File
- ./
apachesolr.module, line 570 - Integration with the Apache Solr search application.
Code
function apachesolr_site_hash() {
if (!($hash = variable_get('apachesolr_site_hash', FALSE))) {
global $base_url;
// Set a random 6 digit base-36 number as the hash.
$hash = substr(base_convert(sha1(uniqid($base_url, TRUE)), 16, 36), 0, 6);
variable_set('apachesolr_site_hash', $hash);
}
return $hash;
}