protected function AcquiaSearchSolrService::adjustUrl in Acquia Connector 7.3
Prepares URL parameters before request.
Parameters
string $url: URL.
Return value
string Adjusted URL.
1 call to AcquiaSearchSolrService::adjustUrl()
- AcquiaSearchSolrService::prepareRequest in acquia_search/
includes/ AcquiaSearchSolrService.php - Prepares request before send.
File
- acquia_search/
includes/ AcquiaSearchSolrService.php, line 90
Class
- AcquiaSearchSolrService
- Class AcquiaSearchSolrService.
Code
protected function adjustUrl($url) {
$url_components = parse_url($url);
if (isset($url_components['scheme'])) {
$url_components['scheme'] = sprintf('%s://', $url_components['scheme']);
}
if (!isset($url_components['query'])) {
$url_components['query'] = '';
}
$query_pieces = drupal_get_query_array($url_components['query']);
$query_pieces['request_id'] = uniqid();
$query_string = drupal_http_build_query($query_pieces);
$url_components['query'] = sprintf('?%s', $query_string);
$url = implode('', $url_components);
return $url;
}