You are here

public function SolrConnectorPluginBase::getSolrMajorVersion in Search API Solr 8.2

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

Gets the current Solr major version.

Parameters

string $version: An optional Solr version string.

Return value

int The Solr major version.

Overrides SolrConnectorInterface::getSolrMajorVersion

1 call to SolrConnectorPluginBase::getSolrMajorVersion()
SolrConnectorPluginBase::getSolrBranch in src/SolrConnector/SolrConnectorPluginBase.php
Gets the current Solr branch name.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 395

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function getSolrMajorVersion($version = '') {
  list($major, , ) = explode('.', $version ?: $this
    ->getSolrVersion());
  return $major;
}