PostConfigStore
in package
implements
ConfigStore
Class PostConfigStore
Store configurations for Solr through a POST to a remote system.
Table of Contents
Interfaces
- ConfigStore
- Interface ConfigStore
Properties
- $config : array<string|int, mixed>
- $extensions : array<string|int, mixed>
Methods
- __construct() : mixed
- FileConfigStore constructor.
- getPath() : string
- Get the path to the config
- instanceDir() : null|string
- Get the instanceDir to tell Solr to use for index $index
- uploadFile() : ResponseInterface
- Upload a file to Solr for index $index
- uploadString() : ResponseInterface
- Upload a file to Solr from a string for index $index
Properties
$config
protected
array<string|int, mixed>
$config
Store configuration
$extensions
protected
static array<string|int, mixed>
$extensions
= ['xml' => 'text/xml', 'txt' => 'text/plain']
file extensions
Methods
__construct()
FileConfigStore constructor.
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
getPath()
Get the path to the config
public
getPath() : string
Return values
stringinstanceDir()
Get the instanceDir to tell Solr to use for index $index
public
instanceDir(string|null $index) : null|string
Parameters
- $index : string|null
-
string - The name of an index (which is also used as the name of the Solr core for the index)
Return values
null|stringuploadFile()
Upload a file to Solr for index $index
public
uploadFile( $index, $file[, null|Countable $handler = null ]) : ResponseInterface
Parameters
- $index :
-
string - The name of an index (which is also used as the name of the Solr core for the index)
- $file :
-
string - A path to a file to upload. The base name of the file will be used on the remote side
- $handler : null|Countable = null
-
A handler used for testing, not to be used in Live environments
Return values
ResponseInterfaceuploadString()
Upload a file to Solr from a string for index $index
public
uploadString(string $index, string $filename, string $string[, null|Countable $handler = null ]) : ResponseInterface
Parameters
- $index : string
-
- The name of an index (which is also used as the name of the Solr core for the index)
- $filename : string
-
- The base name of the file to use on the remote side
- $string : string
-
- The content to upload
- $handler : null|Countable = null
-
A handler used for testing, not to be used in Live environments