mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
Merge pull request #53 from martinhipp/bugfix/tika-version-number-checking
Return version number as string instead of float
This commit is contained in:
commit
c5cfe4ea1e
@ -70,22 +70,22 @@ class TikaRestClient extends Client
|
||||
/**
|
||||
* Get version code
|
||||
*
|
||||
* @return float
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
/** @var Response $response */
|
||||
$response = $this->get('version', $this->getGuzzleOptions());
|
||||
$version = 0.0;
|
||||
$version = 0;
|
||||
|
||||
// Parse output
|
||||
if ($response->getStatusCode() == 200
|
||||
&& preg_match('/Apache Tika (?<version>[\.\d]+)/', $response->getBody(), $matches)
|
||||
) {
|
||||
$version = (float)$matches['version'];
|
||||
$version = $matches['version'];
|
||||
}
|
||||
|
||||
return $version;
|
||||
return (string) $version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user