You are here

public function SearchApiSolrService::getServerLink in Search API Solr 7

Returns a link to the Solr server, if the necessary options are set.

2 calls to SearchApiSolrService::getServerLink()
SearchApiSolrService::configurationForm in includes/service.inc
Implements SearchApiServiceInterface::__construct().
SearchApiSolrService::getExtraInformation in includes/service.inc
Returns additional, service-specific information about this server.

File

includes/service.inc, line 526

Class

SearchApiSolrService
Search service class using Solr server.

Code

public function getServerLink() {
  if (!$this->options) {
    return '';
  }
  $host = $this->options['host'];
  if ($host == 'localhost' && !empty($_SERVER['SERVER_NAME'])) {
    $host = $_SERVER['SERVER_NAME'];
  }
  $url = $this->options['scheme'] . '://' . $host . ':' . $this->options['port'] . $this->options['path'];
  return l($url, $url);
}