Skip to content

Commit 32f03f9

Browse files
committed
Adding new Bundle config values
1 parent bb5ddef commit 32f03f9

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

integrations/symfony-bundle.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,32 @@ Web Debug Toolbar
5656

5757
When using a client configured with ``HttplugBundle``, you will get debug information in the web debug toolbar. It will tell you how many request were made and how many of those that were successful or not. It will also show you detailed information about each request.
5858

59+
You can configure the bundle to show debug information for clients found with discovery. You can also force a specific client to be found when a third party library is using discovery. The configuration below makes sure the client with service id ``httplug.clients.my_guzzle5`` is returned when calling ``HttpClientDiscovery::find()`` . It does also make sure to show debug info for asynchronous clients.
60+
61+
.. code-block:: yaml
62+
63+
httplug:
64+
clients:
65+
my_guzzle5:
66+
factory: 'httplug.factory.guzzle5'
67+
discovery:
68+
client: 'httplug.clients.my_guzzle5'
69+
async_client: 'auto'
70+
71+
The debug info for normal http clients are enabled by default but not for async clients. You can turn all debug info off for auto discovered clients by setting the value to ``false``.
72+
73+
The web profiler page will show you lots of information about the request and also how diffrent plugins changes the message. See example screenshots below.
74+
75+
IMAGES
76+
77+
The body of the HTTP messages is not captured by default because of performance reasons. Turn this on by changing the ``captured_body_length`` configuration.
78+
79+
.. code-block:: yaml
80+
81+
httplug:
82+
toolbar:
83+
captured_body_length: 1000 # Capture the first 1000 chars of the HTTP body
84+
5985
Discovery of Factory Classes
6086
````````````````````````````
6187

@@ -157,6 +183,23 @@ You can configure a client with authentication. Valid authentication types are `
157183
factory: 'httplug.factory.guzzle6'
158184
plugins: ['httplug.plugin.authentication.my_wsse']
159185
186+
Special HTTP clients
187+
````````````````````
188+
189+
If you want to use the ``FlexibleHttpClient`` or ``HttpMethodsClient`` from the ``php-http/message`` package you may specify that on the client configuration.
190+
191+
.. code-block:: yaml
192+
193+
// config.yml
194+
httplug:
195+
clients:
196+
acme:
197+
factory: 'httplug.factory.guzzle6'
198+
flexible_client: true
199+
200+
foobar:
201+
factory: 'httplug.factory.guzzle6'
202+
http_methods_client: true
160203
161204
List of Services
162205
````````````````

integrations/symfony-full-configuration.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ This page shows an example of all configuration values provided by the bundle.
5555
enabled: true
5656
logger: 'logger'
5757
formatter: null
58-
captured_body_length: 0
5958
redirect:
6059
enabled: true
6160
preserve_header: true
@@ -67,6 +66,11 @@ This page shows an example of all configuration values provided by the bundle.
6766
enabled: true
6867
stopwatch: 'debug.stopwatch'
6968
69+
toolbar:
70+
enabled: true
71+
formatter: null # Defaults to FullHttpMessageFormatter
72+
captured_body_length: 0
73+
7074
discovery:
7175
client: 'auto'
7276
async_client: null

0 commit comments

Comments
 (0)