Skip to content

Commit 802d258

Browse files
committed
Merged from 7.10
2 parents 4f39441 + 53a264e commit 802d258

File tree

397 files changed

+2941
-1256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+2941
-1256
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- job:
3+
name: elastic+elasticsearch-php+7.10
4+
display-name: 'elastic / elasticsearch-php # 7.10'
5+
description: Testing the elasticsearch-php 7.10 branch.
6+
parameters:
7+
- string:
8+
name: branch_specifier
9+
default: refs/heads/7.10
10+
description: the Git branch specifier to build (<branchName>, <tagName>,
11+
<commitId>, etc.)
12+
triggers:
13+
- github
14+
- timed: 'H */12 * * *'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ generator/*
2424
util/elasticsearch/
2525
util/cache/
2626
util/*.zip
27+
util/output/
2728

2829
# Sami docs generator
2930
/sami.phar

phpunit-yaml-oss-tests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<php>
1313
<!-- Disable E_USER_DEPRECATED setting E_ALL & ~E_USER_DEPRECATED-->
1414
<ini name="error_reporting" value="16383"/>
15+
<ini name="memory_limit" value="-1" />
1516
</php>
1617
<testsuites>
1718
<testsuite name="Yaml tests">

phpunit-yaml-xpack-tests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<php>
1313
<!-- Disable E_USER_DEPRECATED setting E_ALL & ~E_USER_DEPRECATED-->
1414
<ini name="error_reporting" value="16383"/>
15+
<ini name="memory_limit" value="-1" />
1516
</php>
1617
<testsuites>
1718
<testsuite name="Yaml tests">

src/Elasticsearch/Client.php

Lines changed: 128 additions & 78 deletions
Large diffs are not rendered by default.

src/Elasticsearch/ClientBuilder.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use GuzzleHttp\Ring\Client\Middleware;
3939
use Psr\Log\LoggerInterface;
4040
use Psr\Log\NullLogger;
41+
use ReflectionClass;
4142

4243
class ClientBuilder
4344
{
@@ -564,7 +565,11 @@ public function build(): Client
564565

565566
$this->endpoint = function ($class) use ($serializer) {
566567
$fullPath = '\\Elasticsearch\\Endpoints\\' . $class;
567-
if ($class === 'Bulk' || $class === 'Msearch' || $class === 'MsearchTemplate' || $class === 'MPercolate') {
568+
569+
$reflection = new ReflectionClass($fullPath);
570+
$constructor = $reflection->getConstructor();
571+
572+
if ($constructor && $constructor->getParameters()) {
568573
return new $fullPath($serializer);
569574
} else {
570575
return new $fullPath();

src/Elasticsearch/Connections/Connection.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use Elasticsearch\Common\Exceptions\ScriptLangNotSupportedException;
3636
use Elasticsearch\Common\Exceptions\ServerErrorResponseException;
3737
use Elasticsearch\Common\Exceptions\TransportException;
38+
use Elasticsearch\Common\Exceptions\Unauthorized401Exception;
3839
use Elasticsearch\Serializers\SerializerInterface;
3940
use Elasticsearch\Transport;
4041
use Exception;
@@ -624,7 +625,9 @@ private function process4xxError(array $request, array $response, array $ignore)
624625
}
625626

626627
$responseBody = $this->convertBodyToString($response['body'], $statusCode, $exception);
627-
if ($statusCode === 403) {
628+
if ($statusCode === 401) {
629+
$exception = new Unauthorized401Exception($responseBody, $statusCode);
630+
} elseif ($statusCode === 403) {
628631
$exception = new Forbidden403Exception($responseBody, $statusCode);
629632
} elseif ($statusCode === 404) {
630633
$exception = new Missing404Exception($responseBody, $statusCode);

src/Elasticsearch/Endpoints/AsyncSearch/Delete.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
/**
2323
* Class Delete
2424
* Elasticsearch API name async_search.delete
25-
* Generated running $ php util/GenerateEndpoints.php 7.9
25+
*
26+
* NOTE: this file is autogenerated using util/GenerateEndpoints.php
27+
* and Elasticsearch 7.10.0-SNAPSHOT (8a752f1934da3552113f94d2d03443d325cf4336)
2628
*/
2729
class Delete extends AbstractEndpoint
2830
{

src/Elasticsearch/Endpoints/AsyncSearch/Get.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
/**
2323
* Class Get
2424
* Elasticsearch API name async_search.get
25-
* Generated running $ php util/GenerateEndpoints.php 7.9
25+
*
26+
* NOTE: this file is autogenerated using util/GenerateEndpoints.php
27+
* and Elasticsearch 7.10.0-SNAPSHOT (8a752f1934da3552113f94d2d03443d325cf4336)
2628
*/
2729
class Get extends AbstractEndpoint
2830
{

src/Elasticsearch/Endpoints/AsyncSearch/Submit.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
/**
2222
* Class Submit
2323
* Elasticsearch API name async_search.submit
24-
* Generated running $ php util/GenerateEndpoints.php 7.9
24+
*
25+
* NOTE: this file is autogenerated using util/GenerateEndpoints.php
26+
* and Elasticsearch 7.10.0-SNAPSHOT (8a752f1934da3552113f94d2d03443d325cf4336)
2527
*/
2628
class Submit extends AbstractEndpoint
2729
{

0 commit comments

Comments
 (0)