You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG-7.0.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@ This changelog references the relevant changes (bug and security fixes) done
5
5
in 7.x versions.
6
6
7
7
### 7.1.1 (2026-xx-xx)
8
+
* Added Elasticsearch 9 and Elastica 9 support.
9
+
*`headers` client config is now applied via `Transport::setHeader()` so it works uniformly across Guzzle, Symfony HTTP Client, and elastic-transport's bundled Curl client.
10
+
*`timeout` client config is now translated to `CURLOPT_TIMEOUT` at runtime when the active transport client is elastic-transport's bundled Curl — Guzzle/Symfony HTTP Client keep consuming the original `'timeout'` key as before.
11
+
* Default config no longer injects `'headers' => []` / `'timeout' => 30` into `http_client_options`, which would otherwise break elastic-transport's bundled Curl client (PHP 8+ `ValueError` on unknown `curl_setopt_array` keys).
12
+
***Deprecated** the top-level `headers` and `timeout` client config. Move them into `client_options` — for Guzzle/Symfony HTTP Client use `headers` / `timeout`, for the bundled Curl client use `CURLOPT_HTTPHEADER` / `CURLOPT_TIMEOUT`.
8
13
* Fix deprecated Symfony method call.
9
14
* Instantiate custom repositories using the DI service locator.
10
15
* Add compatibility with `doctrine/doctrine-bundle` 3.x, `doctrine/phpcr-odm` 3.x and Symfony 8.0 in highest-deps CI.
> **Deprecated since 7.1**: the top-level `headers` client option is deprecated.
8
+
> Move headers into `client_options` for your HTTP client (`headers` key for
9
+
> Guzzle/Symfony HTTP Client, `CURLOPT_HTTPHEADER` for elastic-transport's
10
+
> bundled Curl client).
11
+
7
12
It may be necessary to set HTTP headers on the Elastica client, for example an
8
13
Authorization header.
9
14
10
-
They can be set using the `headers` configuration key:
15
+
They can be set using the deprecated `headers` configuration key (still works,
16
+
applied via `Transport::setHeader` so it covers every HTTP client):
11
17
12
18
```yaml
13
19
# app/config/config.yml
@@ -59,7 +65,7 @@ fos_elastica:
59
65
Setting other client options
60
66
--------------------
61
67
62
-
Any other client option for Elastica client can be set using the `client_options` configuration key:
68
+
`client_options` is a raw pass-through to the underlying HTTP client (Guzzle, Symfony HTTP Client, or elastic-transport's bundled Curl client). Configure it with whatever option names your client understands:
63
69
64
70
```yaml
65
71
# app/config/config.yml
@@ -68,7 +74,16 @@ fos_elastica:
68
74
default:
69
75
hosts: ['http://example.com:80']
70
76
client_options:
71
-
!php/const \CURLOPT_RANDOM_FILE: /dev/urandom
77
+
# Guzzle / Symfony HTTP Client
78
+
timeout: 30
79
+
connect_timeout: 10
72
80
proxy: 'http://localhost:8125'
73
-
connect_timeout: 10 # if using Guzzle
81
+
82
+
# elastic-transport's bundled Curl client (used when neither Guzzle nor
83
+
# Symfony HTTP Client is installed). Use CURLOPT_* integer keys:
84
+
!php/const \CURLOPT_TIMEOUT: 30
85
+
!php/const \CURLOPT_CONNECTTIMEOUT: 10
86
+
!php/const \CURLOPT_RANDOM_FILE: /dev/urandom
74
87
```
88
+
89
+
> **Deprecated since 7.1:** the top-level `timeout` client option is no longer applied — move it into `client_options` for your specific HTTP client (`timeout` for Guzzle/Symfony, `CURLOPT_TIMEOUT` for bundled Curl).
Copy file name to clipboardExpand all lines: src/DependencyInjection/Configuration.php
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -356,12 +356,22 @@ private function addClientsSection(ArrayNodeDefinition $rootNode): void
356
356
->prototype('scalar')->end()
357
357
->end()
358
358
->arrayNode('headers')
359
+
->setDeprecated(
360
+
'friendsofsymfony/elastica-bundle',
361
+
'7.1',
362
+
'The "%node%" option is deprecated. Configure headers via "client_options" instead — for Guzzle/Symfony HTTP Client use "headers", for elastic-transport\'s bundled Curl client use CURLOPT_HTTPHEADER.',
363
+
)
359
364
->normalizeKeys(false)
360
365
->useAttributeAsKey('name')
361
366
->prototype('scalar')->end()
362
367
->end()
363
368
->scalarNode('timeout')
364
369
->defaultValue(30)
370
+
->setDeprecated(
371
+
'friendsofsymfony/elastica-bundle',
372
+
'7.1',
373
+
'The "%node%" option is deprecated. Configure your HTTP client directly via "client_options" instead — "timeout" for Guzzle/Symfony HTTP Client, CURLOPT_TIMEOUT for elastic-transport\'s bundled Curl client.',
0 commit comments