You are here

public function SearchApiAcquiaSearchConnection::__construct in Acquia Search for Search API 7

Overrides SearchApiSolrConnection::__construct().

Uses the Acquia Search HTTP transport instead of the transport provided by the Search API Solr module. This allows us to add the tokens and variables required to authenticate against Acquia's HMAC authentication scheme.

Overrides SearchApiSolrConnection::__construct

See also

SearchApiAcquiaSearchHttpTransport

File

includes/SearchApiAcquiaSearchConnection.php, line 22
Contains SearchApiAcquiaSearchConnection.

Class

SearchApiAcquiaSearchConnection
Establishes a connection to the Acquia Search service.

Code

public function __construct(array $options) {
  parent::__construct($options);
  $this->newClient = trim(parent::SVN_REVISION, '$ :A..Za..z') > 40;
  if ($this->newClient) {
    $this->_httpTransport = new SearchApiAcquiaSearchHttpTransport($this->http_auth);
    if (isset($options['derived_key'])) {
      $this->_httpTransport
        ->setDerivedKey($options['derived_key']);
    }
  }
  else {
    throw new Exception(t('This module only works with the latest version of SolrPhpClient'));
  }
}