You are here

public function SearchApiSolrCommands::getServerConfig in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 src/Commands/SearchApiSolrCommands.php \Drupal\search_api_solr\Commands\SearchApiSolrCommands::getServerConfig()
  2. 4.x src/Commands/SearchApiSolrCommands.php \Drupal\search_api_solr\Commands\SearchApiSolrCommands::getServerConfig()

Gets the config for a Solr search server.

@command search-api-solr:get-server-config

@usage drush search-api-solr:get-server-config server_id file_name Get the config files for a solr server and save it as zip file.

@aliases solr-gsc,sasm-gsc,search-api-solr-get-server-config,search-api-solr-multilingual-get-server-config

Parameters

string $server_id: The ID of the server.

string $file_name: The file name of the config zip that should be created.

string $solr_version: The targeted Solr version.

Throws

\Drupal\search_api\ConsoleException

\Drupal\search_api\SearchApiException

\ZipStream\Exception\FileNotFoundException

\ZipStream\Exception\FileNotReadableException

\ZipStream\Exception\OverflowException

File

src/Commands/SearchApiSolrCommands.php, line 113

Class

SearchApiSolrCommands
Defines Drush commands for the Search API Solr.

Namespace

Drupal\search_api_solr\Commands

Code

public function getServerConfig($server_id, $file_name = NULL, $solr_version = NULL, array $options = []) {
  if (!$options['pipe'] && $file_name === NULL) {
    throw new ConsoleException('Required argument missing ("file_name"), and no --pipe option specified.');
  }
  $this->commandHelper
    ->getServerConfigCommand($server_id, $file_name, $solr_version);
}