diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 4cd3b2154..03e572546 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -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. diff --git a/README.md b/README.md index fdb73af79..04c345159 100644 --- a/README.md +++ b/README.md @@ -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-) @@ -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 🔮