You are here

public function SolrConnectorPluginBase::alterConfigFiles in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::alterConfigFiles()
  2. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::alterConfigFiles()

Alter the newly assembled Solr configuration files.

Parameters

string[] $files: Array of config files keyed by file names.

string $lucene_match_version: Lucene (Solr) minor version string.

string $server_id: Optional Search API server id. Will be set in most cases but might be empty when the config generation is triggered via UI or drush.

Overrides SolrConnectorInterface::alterConfigFiles

1 call to SolrConnectorPluginBase::alterConfigFiles()
StandardSolrCloudConnector::alterConfigFiles in src/Plugin/SolrConnector/StandardSolrCloudConnector.php
Alter the newly assembled Solr configuration files.
1 method overrides SolrConnectorPluginBase::alterConfigFiles()
StandardSolrCloudConnector::alterConfigFiles in src/Plugin/SolrConnector/StandardSolrCloudConnector.php
Alter the newly assembled Solr configuration files.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 1104

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function alterConfigFiles(array &$files, string $lucene_match_version, string $server_id = '') {
  if (!empty($this->configuration['jmx'])) {
    $files['solrconfig_extra.xml'] .= "<jmx />\n";
  }
  if (!empty($this->configuration['solr_install_dir'])) {
    $files['solrcore.properties'] = preg_replace("/solr\\.install\\.dir.*\$/m", 'solr.install.dir=' . $this->configuration['solr_install_dir'], $files['solrcore.properties']);
  }
  else {
    $files['solrcore.properties'] = preg_replace("/solr\\.install\\.dir.*\$/m", '', $files['solrcore.properties']);
  }
}