You are here

protected function SolrConnectorPluginBase::getServerUri in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getServerUri()
  2. 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getServerUri()
  3. 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getServerUri()

Returns a the Solr server URI.

3 calls to SolrConnectorPluginBase::getServerUri()
SolrConnectorPluginBase::getCoreLink in src/SolrConnector/SolrConnectorPluginBase.php
Returns a link to the Solr core, if the necessary options are set.
SolrConnectorPluginBase::getDataFromHandler in src/SolrConnector/SolrConnectorPluginBase.php
Gets data from a Solr endpoint using a given handler.
SolrConnectorPluginBase::getServerLink in src/SolrConnector/SolrConnectorPluginBase.php
Returns a link to the Solr server.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 380

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

protected function getServerUri() {
  $this
    ->connect();
  $url_path = $this->solr
    ->getEndpoint()
    ->getServerUri();
  if ($this->configuration['host'] === 'localhost' && !empty($_SERVER['SERVER_NAME'])) {
    $url_path = str_replace('localhost', $_SERVER['SERVER_NAME'], $url_path);
  }
  return $url_path;
}