public function SolrConnectorPluginBase::getFile in Search API Solr 8.3
Same name and namespace in other branches
- 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getFile()
- 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getFile()
- 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getFile()
Retrieves a config file or file list from the Solr server.
Uses the admin/file request handler.
Parameters
string|null $file: (optional) The name of the file to retrieve. If the file is a directory, the directory contents are instead listed and returned. NULL represents the root config directory.
Return value
\Solarium\Core\Client\Response A Solarium response object containing either the file contents or a file list.
Throws
\Drupal\search_api_solr\SearchApiSolrException
Overrides SolrConnectorInterface::getFile
File
- src/
SolrConnector/ SolrConnectorPluginBase.php, line 1072
Class
- SolrConnectorPluginBase
- Defines a base class for Solr connector plugins.
Namespace
Drupal\search_api_solr\SolrConnectorCode
public function getFile($file = NULL) {
$this
->connect();
$query = $this->solr
->createApi([
'handler' => $this->configuration['core'] . '/admin/file',
]);
if ($file) {
$query
->addParam('file', $file);
}
return $this
->execute($query)
->getResponse();
}