Skip to content

Commit 24656b9

Browse files
committed
Updated 8.0 BC breaks
1 parent aeb7aaa commit 24656b9

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

BREAKING_CHANGES.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
# 8.0
22

33
This major release is a complete new PHP client for Elasticsearch. We build it from scratch!
4-
We tried to reduce the BC breaks as much as possible but there are some big differences :rage:
4+
We tried to reduce the BC breaks as much as possible but there are some (big) differences:
55

66
## Architectural changes:
77

88
- we changed the namespace, now everything is under `Elastic\Elasticsearch`;
9-
- we used the [elastic-transport-php](https://github.com/elastic/elastic-transport-php) library
10-
to manage the HTTP requests and responses; This library allows the usage of any [PSR-18](https://www.php-fig.org/psr/psr-18/)
11-
client.
12-
- we changed the response type of each endpoints using a wrapper class of a [PSR-7](https://www.php-fig.org/psr/psr-7/)
13-
response. This class allows the access of the body response as array or object. This means
14-
you can access the API response as in 7.x, no BC break here! :angel:
9+
- we used the [elastic-transport-php](https://github.com/elastic/elastic-transport-php) library for HTTP communications;
10+
- we changed the `Exception` model, using the namespace `Elastic\Elasticsearch\Exception`. All the exceptions extends the
11+
`ElasticsearchException` interface, as in 7.x;
12+
- we changed the response type of each endpoints using an [Elasticsearch](src/Response/Elasticsearch.php) response class.
13+
This class wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the access of the body response
14+
as array or object. This means you can access the API response as in 7.x, no BC break here! :angel:
1515

1616
## Specific changes:
1717

18-
- to be completed
18+
The following functions has been removed:
19+
20+
- `ClientBuilder::getEndpoint()`
21+
- `ClientBuilder::getRegisteredNamespacesBuilders()`
22+
- `ClientBuilder::getRegisteredNamespacesBuilders()`
23+
- `ClientBuilder::defaultHandler()`
24+
- `ClientBuilder::multiHandler()`
25+
- `ClientBuilder::singleHandler()`
26+
- `ClientBuilder::setConnectionFactory()`
27+
- `ClientBuilder::setConnectionPool()`
28+
- `ClientBuilder::setEndpoint()`
29+
- `ClientBuilder::registerNamespace()`
30+
- `ClientBuilder::setTransport()`, you can specify an HTTP PSR-18 client using `ClientBuilder::setHttpClient()`
31+
- `ClientBuilder::setHandler()`
32+
- `ClientBuilder::setTracer()`, you can only set a Logger using `ClientBuilder::setLogger()`
33+
- `ClientBuilder::setSerializer()`
34+
- `ClientBuilder::setConnectionParams()`, you can use `ClientBuilder::setHttpClientOptions()` instead
35+
- `ClientBuilder::setSelector()`
36+
- `ClientBuilder::setSniffOnStart()`
37+
- `ClientBuilder::includePortInHostHeader()`
38+
1939
# 7.17
2040

2141
- We changed the signature of `Elasticsearch\Common\EmptyLogger::log` adding the `void` return type.

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Elasticsearch PHP client
55

66
[![Build status](https://github.com/elastic/elasticsearch-php/workflows/PHP%20test/badge.svg)](https://github.com/elastic/elasticsearch-php/actions) [![Latest Stable Version](https://poser.pugx.org/elasticsearch/elasticsearch/v/stable)](https://packagist.org/packages/elasticsearch/elasticsearch) [![Total Downloads](https://poser.pugx.org/elasticsearch/elasticsearch/downloads)](https://packagist.org/packages/elasticsearch/elasticsearch)
77

8+
This is the official PHP client for connecting to [Elasticsearch](https://www.elastic.co/elasticsearch/).
9+
810
## Contents
911

1012
- [Getting started](#getting-started-)
@@ -85,7 +87,23 @@ For more information about the Elasticsearch REST API you can read the official
8587

8688
## Backward Incompatible Changes :boom:
8789

88-
To be completed
90+
The 8.0.0 version of `elasticsearch-php` contains a new implementation compared with 7.x.
91+
It supports [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages and [PSR-18](https://www.php-fig.org/psr/psr-18/)
92+
for HTTP client communications.
93+
94+
We tried to reduce the BC breaks as much as possible with `7.x` but there are some (big) differences:
95+
96+
- we changed the namespace, now everything is under `Elastic\Elasticsearch`;
97+
- we used the [elastic-transport-php](https://github.com/elastic/elastic-transport-php) library for HTTP communications;
98+
- we changed the `Exception` model, using the namespace `Elastic\Elasticsearch\Exception`. All the exceptions extends the
99+
`ElasticsearchException` interface, as in 7.x;
100+
- we changed the response type of each endpoints using an [Elasticsearch](src/Response/Elasticsearch.php) response class.
101+
This class wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the access of the body response
102+
as array or object. This means you can access the API response as in 7.x, no BC break here! :angel:
103+
104+
You can have a look at the [BREAKING_CHANGES](BREAKING_CHANGES.md) file for more information.
105+
106+
## Specific changes:
89107

90108
## FAQ 🔮
91109

0 commit comments

Comments
 (0)