You are here

public function SolrConnectorPluginBase::getSolrMajorVersion in Search API Solr 8.3

Same name and namespace in other branches
  1. 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getSolrMajorVersion()
  2. 8.2 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

2 calls to SolrConnectorPluginBase::getSolrMajorVersion()
SolrConnectorPluginBase::getSolrBranch in src/SolrConnector/SolrConnectorPluginBase.php
Gets the current Solr branch name.
StandardSolrCloudConnector::alterConfigFiles in src/Plugin/SolrConnector/StandardSolrCloudConnector.php
Alter the newly assembled Solr configuration files.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 428

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

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