diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 3b69c66fc..080d2eefa 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,3 +1,16 @@ +# 7.0 + +- Requirement of PHP 7.1 instead of 7.0 that is not supported since 1 Jan 2019. + See [PHP supported version](https://www.php.net/supported-versions.php) for + more information. + +- Elasticsearch 7.0 deprecated APIs that accept types, introduced new typeless + APIs, and removed support for the _default_ mapping. Read [this](https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0) + blog post for more information. + +- Added type hints and return type declarations where possible + [#897](https://github.com/elastic/elasticsearch-php/pull/897) + # 6.7 - `{type}` part in `indices.put_mapping` API is not required anymore, see new specification [here](https://github.com/elastic/elasticsearch/blob/v6.7.0/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0ba60a0..ae95d02b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## Release 7.0.0 + +- Requirement of PHP 7.1 instead of 7.0 that is not supported since 1 Jan 2019. + [#897](https://github.com/elastic/elasticsearch-php/pull/897) +- Code refactoring using type hints and return type declarations where possible + [#897](https://github.com/elastic/elasticsearch-php/pull/897) +- Update vendor libraries (PHPUnit 7.5, Symfony YAML 4.3, etc) + [#897](https://github.com/elastic/elasticsearch-php/pull/897) +- Updated all the API endpoints using the [latest 7.0.0 specs](https://github.com/elastic/elasticsearch/tree/v7.0.0/rest-api-spec/src/main/resources/rest-api-spec/api) of Elasticsearch [#897](https://github.com/elastic/elasticsearch-php/pull/897) +- Added the `User-Agent` in each HTTP request [#898](https://github.com/elastic/elasticsearch-php/pull/898) +- Simplified the logging methods `logRequestFail($request, $response, $exception)` + and `logRequestSuccess($request, $response)` in `Elasticsearch\Connections\Connection` + [#876](https://github.com/elastic/elasticsearch-php/pull/876) +- Fix `json_encode` for unicode(emoji) characters [856](https://github.com/elastic/elasticsearch-php/pull/856) +- Fix HTTP port specification using CURLOPT_PORT, not anymore in the host [782](https://github.com/elastic/elasticsearch-php/pull/782) + +### Testing + + ## Release 6.7.1 - Added `track_total_hits` in `search` endpoint [0c9ff47](https://github.com/elastic/elasticsearch-php/commit/9f4f0dfa331c4f50d2c88c0068afd3062e6ea353) diff --git a/README.md b/README.md index cf29d980e..c5a3a32f1 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Version Matrix | Elasticsearch Version | Elasticsearch-PHP Branch | | --------------------- | ------------------------ | +| >= 7.0, < 8.0 | 7.0 | | >= 6.6, < 7.0 | 6.7.x | | >= 6.0, < 6.6 | 6.5.x | | >= 5.0, < 6.0 | 5.0 | @@ -36,6 +37,7 @@ Version Matrix | >= 1.0, < 2.0 | 1.0 or 2.0 | | <= 0.90.x | 0.4 | + - If you are using Elasticsearch 7.x, use Elasticsearch-PHP 7.0 branch. - If you are using Elasticsearch 6.6 to 6.7, use Elasticsearch-PHP 6.7.x branch. - If you are using Elasticsearch 6.0 to 6.5, use Elasticsearch-PHP 6.5.x branch. - If you are using Elasticsearch 5.x, use Elasticsearch-PHP 5.0 branch. @@ -51,12 +53,12 @@ Installation via Composer ------------------------- The recommended method to install _Elasticsearch-PHP_ is through [Composer](http://getcomposer.org). -1. Add `elasticsearch/elasticsearch` as a dependency in your project's `composer.json` file (change version to suit your version of Elasticsearch, for instance for ES 6.7): +1. Add `elasticsearch/elasticsearch` as a dependency in your project's `composer.json` file (change version to suit your version of Elasticsearch, for instance for ES 7.0): ```json { "require": { - "elasticsearch/elasticsearch": "^6.7" + "elasticsearch/elasticsearch": "^7.0" } } ``` @@ -90,11 +92,12 @@ You can find out more on how to install Composer, configure autoloading, and oth PHP Version Requirement ---- -Version 6.0 of this library requires at least PHP version 7.0.0 to function. In addition, it requires the native JSON +Version 7.0 of this library requires at least PHP version 7.1 to function. In addition, it requires the native JSON extension to be version 1.3.7 or higher. | Elasticsearch-PHP Branch | PHP Version | | ----------- | ------------------------ | +| 7.0 | >= 7.1.0 | | 6.0 | >= 7.0.0 | | 5.0 | >= 5.6.6 | | 2.0 | >= 5.4.0 | diff --git a/docs/breaking-changes.asciidoc b/docs/breaking-changes.asciidoc index 94a6ee69e..6d0a74985 100644 --- a/docs/breaking-changes.asciidoc +++ b/docs/breaking-changes.asciidoc @@ -1,17 +1,19 @@ [[breaking_changes]] -== Breaking changes from 5.x +== Breaking changes from 6.x -### Removal of ClientBuilder::defaultLogger() +### Moving from types to typeless APIs in Elasticsearch 7.0 -In 5.x there is the ability to create a default Logger object, which has been removed. It is now required to explicitly make a Logger object. +Elasticsearch 7.0 deprecated APIs that accept types, introduced new typeless +APIs, and removed support for the _default_ mapping. Read [this](https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0) +blog post for more information. -5.x -``` -$logger = ClientBuilder::defaultLogger('path_to_log_file'); -``` +### Type hint and return type -6.5 -``` -$logger = new Logger('name'); -$logger->pushHandler(new StreamHandler('path_to_log_file', Logger::WARNING); -``` +Added type hints and return type declarations in all the code base, where possible. +See PR [#897](https://github.com/elastic/elasticsearch-php/pull/897). + +### PHP 7.1+ Requirement + +We require using PHP 7.1+ for elasticsearch-php. PHP 7.0 is not supported since +1st Jan 2019. See [PHP supported version](https://www.php.net/supported-versions.php) for +more information. diff --git a/docs/installation.asciidoc b/docs/installation.asciidoc index 96d9a88bb..d6a5dee94 100644 --- a/docs/installation.asciidoc +++ b/docs/installation.asciidoc @@ -27,11 +27,12 @@ The master branch will always track Elasticsearch master, but it is not recommen [width="40%",options="header",frame="topbot"] |============================ |Elasticsearch Version | Elasticsearch-PHP Branch -| >= 6.6, <= 6.7 | `6.7` -| >= 6.0, <= 6.5 | `6.5` -| >= 5.0, <= 6.0 | `5.0` -| >= 1.0, <= 5.0 | `1.0`, `2.0` -| <= 0.90.* | `0.4` +| >= 7.0, < 8.0 | `7.0` +| >= 6.6, <= 6.7 | `6.7.x` +| >= 6.0, <= 6.5 | `6.5.c` +| >= 5.0, < 6.0 | `5.0` +| >= 1.0, < 5.0 | `1.0`, `2.0` +| <= 0.90.* | `0.4` |============================ === Composer Installation @@ -42,7 +43,7 @@ The master branch will always track Elasticsearch master, but it is not recommen -------------------------- { "require": { - "elasticsearch/elasticsearch": "~6.7.0" + "elasticsearch/elasticsearch": "~7.0" } } -------------------------- diff --git a/docs/php-version-requirement.asciidoc b/docs/php-version-requirement.asciidoc index bc3cd9b5c..6a6734205 100644 --- a/docs/php-version-requirement.asciidoc +++ b/docs/php-version-requirement.asciidoc @@ -1,5 +1,5 @@ [[php_version_requirement]] == PHP Version Requirement -Version 6.0 of Elasticsearch-PHP requires PHP version 7.0.0 or higher. In addition, it requires the native JSON -extension to be version 1.3.7 or higher. +Version 7.0 of Elasticsearch-PHP requires PHP version 7.1.0 or higher. +In addition, it requires the native JSON extension to be version 1.3.7 or higher. diff --git a/docs/quickstart.asciidoc b/docs/quickstart.asciidoc index 8c3497f97..acfeac61d 100644 --- a/docs/quickstart.asciidoc +++ b/docs/quickstart.asciidoc @@ -11,7 +11,7 @@ This section will give you a quick overview of the client and how the major func ---------------------------- { "require": { - "elasticsearch/elasticsearch": "~5.0" + "elasticsearch/elasticsearch": "~7.0" } } ---------------------------- @@ -266,4 +266,3 @@ actions are available under the `$client` object (indexing, searching, getting, are located under the `$client->indices()` and `$client->cluster()` objects, respectively. Check out the rest of the Documentation to see how the entire client works. -