mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
Merge branch '3.0'
This commit is contained in:
commit
b4c634bb1f
10
.travis.yml
10
.travis.yml
@ -13,13 +13,13 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL RECIPE_VERSION=1.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=4.3.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
env: DB=MYSQL RECIPE_VERSION=1.1.x-dev PHPUNIT_TEST=1
|
|
||||||
- php: 7.1
|
|
||||||
env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
|
|
||||||
- php: 7.2
|
|
||||||
env: DB=MYSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1
|
||||||
|
- php: 7.1
|
||||||
|
env: DB=PGSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_COVERAGE_TEST=1
|
||||||
|
- php: 7.2
|
||||||
|
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1
|
||||||
- php: 7.3
|
- php: 7.3
|
||||||
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1
|
||||||
|
|
||||||
|
@ -70,22 +70,22 @@ class TikaRestClient extends Client
|
|||||||
/**
|
/**
|
||||||
* Get version code
|
* Get version code
|
||||||
*
|
*
|
||||||
* @return float
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getVersion()
|
public function getVersion()
|
||||||
{
|
{
|
||||||
/** @var Response $response */
|
/** @var Response $response */
|
||||||
$response = $this->get('version', $this->getGuzzleOptions());
|
$response = $this->get('version', $this->getGuzzleOptions());
|
||||||
$version = 0.0;
|
$version = 0;
|
||||||
|
|
||||||
// Parse output
|
// Parse output
|
||||||
if ($response->getStatusCode() == 200
|
if ($response->getStatusCode() == 200
|
||||||
&& preg_match('/Apache Tika (?<version>[\.\d]+)/', $response->getBody(), $matches)
|
&& 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