Skip to content

Commit dc3b707

Browse files
authored
Merge pull request #252 from php-http/bundle-doc
tweak bundle doc
2 parents cb6afc2 + 133a548 commit dc3b707

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

integrations/symfony-bundle.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ clients.
4545
);
4646
}
4747
48-
You will find all available configuration at the
48+
You can find all available configuration at the
4949
:doc:`full configuration </integrations/symfony-full-configuration>` page.
5050

5151
Usage
@@ -234,7 +234,7 @@ Additionally you can configure any of the ``php-http/plugins`` specifically on
234234
a client. For some plugins this is the only place where they can be configured.
235235
The order in which you specify the plugins **does** matter.
236236

237-
Configure plugins directly on the client:
237+
You can configure many of the plugins directly on the client:
238238

239239
.. code-block:: yaml
240240
@@ -256,7 +256,12 @@ Configure plugins directly on the client:
256256
password: 'p4ssw0rd'
257257
258258
259-
Configure the cache plugin globally and use it in the ``acme`` client:
259+
See :doc:`full configuration </integrations/symfony-full-configuration>` for
260+
the full list of plugins you can configure.
261+
262+
Alternatively, the same configuration also works on a global level. With this,
263+
you can configure plugins once and then use them in several clients. The plugin
264+
service names follow the pattern ``httplug.plugin.<name>``:
260265

261266
.. code-block:: yaml
262267
@@ -270,8 +275,14 @@ Configure the cache plugin globally and use it in the ``acme`` client:
270275
factory: 'httplug.factory.guzzle6'
271276
plugins:
272277
- 'httplug.plugin.cache'
278+
app:
279+
plugins:
280+
- 'httplug.plugin.cache'
273281
274-
Configure a service for your custom plugin and use it in the client:
282+
To use a custom plugin or when you need specific configuration that is not
283+
covered by the bundle configuration, you can configure the plugin as a normal
284+
symfony service and then reference that service name in the plugin list of your
285+
client:
275286

276287
.. code-block:: yaml
277288

integrations/symfony-full-configuration.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ This page shows an example of all configuration values provided by the bundle.
1919
uri_factory: ~
2020
stream_factory: ~
2121
22-
plugins: # Global plugin configuration. Plugins need to be explicitly added to clients.
22+
plugins: # Global plugin configuration. When configured here, plugins need to be explicitly added to clients by service name.
2323
authentication:
24+
# The names can be freely chosen, the authentication type is specified in the "type" option
2425
my_basic:
2526
type: 'basic'
2627
username: 'my_username'

0 commit comments

Comments
 (0)