class TikaRestClient extends Client (View source)

Properties

protected array $options

Authentication options to be sent to the Tika server

protected array $mimes

Methods

public
__construct(string $baseUrl = '', array $config = [])

No description

public
bool
isAvailable()

Detect if the service is available

public
string
getVersion()

Get version code

public
array
getSupportedMimes()

Gets supported mime data. May include aliased mime types.

public
string
tika(string $file)

Extract text content from a given file.

protected
array
getGuzzleOptions(array $options = [])

Assembles an array of request options to pass to Guzzle

Details

__construct(string $baseUrl = '', array $config = [])

No description

Parameters

string $baseUrl
array $config

bool isAvailable()

Detect if the service is available

Return Value

bool

string getVersion()

Get version code

Return Value

string

array getSupportedMimes()

Gets supported mime data. May include aliased mime types.

Return Value

array

string tika(string $file)

Extract text content from a given file.

Logs a notice-level error if the document can't be parsed.

Parameters

string $file

Full filesystem path to a file to post

Return Value

string

Content of the file extracted as plain text

protected array getGuzzleOptions(array $options = [])

Assembles an array of request options to pass to Guzzle

Parameters

array $options

Authentication (etc) will be merged into this array and returned

Return Value

array