Skip to content

tweak bundle doc #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ clients.
);
}

You will find all available configuration at the
You can find all available configuration at the
:doc:`full configuration </integrations/symfony-full-configuration>` page.

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

Configure plugins directly on the client:
You can configure many of the plugins directly on the client:

.. code-block:: yaml

Expand All @@ -256,7 +256,12 @@ Configure plugins directly on the client:
password: 'p4ssw0rd'


Configure the cache plugin globally and use it in the ``acme`` client:
See :doc:`full configuration </integrations/symfony-full-configuration>` for
the full list of plugins you can configure.

Alternatively, the same configuration also works on a global level. With this,
you can configure plugins once and then use them in several clients. The plugin
service names follow the pattern ``httplug.plugin.<name>``:

.. code-block:: yaml

Expand All @@ -270,8 +275,14 @@ Configure the cache plugin globally and use it in the ``acme`` client:
factory: 'httplug.factory.guzzle6'
plugins:
- 'httplug.plugin.cache'
app:
plugins:
- 'httplug.plugin.cache'

Configure a service for your custom plugin and use it in the client:
To use a custom plugin or when you need specific configuration that is not
covered by the bundle configuration, you can configure the plugin as a normal
symfony service and then reference that service name in the plugin list of your
client:

.. code-block:: yaml

Expand Down
3 changes: 2 additions & 1 deletion integrations/symfony-full-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ This page shows an example of all configuration values provided by the bundle.
uri_factory: ~
stream_factory: ~

plugins: # Global plugin configuration. Plugins need to be explicitly added to clients.
plugins: # Global plugin configuration. When configured here, plugins need to be explicitly added to clients by service name.
authentication:
# The names can be freely chosen, the authentication type is specified in the "type" option
my_basic:
type: 'basic'
username: 'my_username'
Expand Down