Skip to content

Commit

Permalink
Updated 8.0 BC breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Mar 2, 2022
1 parent aeb7aaa commit 24656b9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
36 changes: 28 additions & 8 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# 8.0

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

## Architectural changes:

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

## Specific changes:

- to be completed
The following functions has been removed:

- `ClientBuilder::getEndpoint()`
- `ClientBuilder::getRegisteredNamespacesBuilders()`
- `ClientBuilder::getRegisteredNamespacesBuilders()`
- `ClientBuilder::defaultHandler()`
- `ClientBuilder::multiHandler()`
- `ClientBuilder::singleHandler()`
- `ClientBuilder::setConnectionFactory()`
- `ClientBuilder::setConnectionPool()`
- `ClientBuilder::setEndpoint()`
- `ClientBuilder::registerNamespace()`
- `ClientBuilder::setTransport()`, you can specify an HTTP PSR-18 client using `ClientBuilder::setHttpClient()`
- `ClientBuilder::setHandler()`
- `ClientBuilder::setTracer()`, you can only set a Logger using `ClientBuilder::setLogger()`
- `ClientBuilder::setSerializer()`
- `ClientBuilder::setConnectionParams()`, you can use `ClientBuilder::setHttpClientOptions()` instead
- `ClientBuilder::setSelector()`
- `ClientBuilder::setSniffOnStart()`
- `ClientBuilder::includePortInHostHeader()`

# 7.17

- We changed the signature of `Elasticsearch\Common\EmptyLogger::log` adding the `void` return type.
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Elasticsearch PHP client

[![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)

This is the official PHP client for connecting to [Elasticsearch](https://www.elastic.co/elasticsearch/).

## Contents

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

## Backward Incompatible Changes :boom:

To be completed
The 8.0.0 version of `elasticsearch-php` contains a new implementation compared with 7.x.
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/)
for HTTP client communications.

We tried to reduce the BC breaks as much as possible with `7.x` but there are some (big) differences:

- we changed the namespace, now everything is under `Elastic\Elasticsearch`;
- we used the [elastic-transport-php](https://github.com/elastic/elastic-transport-php) library for HTTP communications;
- we changed the `Exception` model, using the namespace `Elastic\Elasticsearch\Exception`. All the exceptions extends the
`ElasticsearchException` interface, as in 7.x;
- we changed the response type of each endpoints using an [Elasticsearch](src/Response/Elasticsearch.php) response class.
This class wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the access of the body response
as array or object. This means you can access the API response as in 7.x, no BC break here! :angel:

You can have a look at the [BREAKING_CHANGES](BREAKING_CHANGES.md) file for more information.

## Specific changes:

## FAQ 🔮

Expand Down

0 comments on commit 24656b9

Please sign in to comment.