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: integrations/symfony-bundle.rst
+34-36
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,12 @@ Symfony Bundle
3
3
4
4
This bundle integrate HTTPlug with the Symfony framework. The bundle helps to register services for all your clients and makes sure all the configuration is in one place. The bundle also feature a toolbar plugin with information about your requests.
5
5
6
+
This guide explains how to configure HTTPlug in the Symfony framework. See the :doc:`../httplug/tutorial` for examples how to use HTTPlug in general.
6
7
7
8
Installation
8
9
````````````
9
10
10
-
Install the Httplug bundle with composer and enable it in your AppKernel.php.
11
+
Install the HTTPlug bundle with composer and enable it in your AppKernel.php.
11
12
12
13
.. code-block:: bash
13
14
@@ -53,7 +54,7 @@ Web Debug Toolbar
53
54
:align:right
54
55
:width:120px
55
56
56
-
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.
57
+
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.
57
58
58
59
Discovery of Factory Classes
59
60
````````````````````````````
@@ -85,11 +86,8 @@ You can configure your clients with default options. These default values will b
85
86
config:
86
87
# These options are given to Guzzle without validation.
87
88
defaults:
88
-
base_uri: 'http://google.se/'
89
89
verify_ssl: false
90
90
timeout: 4
91
-
headers:
92
-
Content-Type: 'application/json'
93
91
acme:
94
92
factory: 'httplug.factory.curl'
95
93
config:
@@ -103,7 +101,7 @@ You can configure your clients with default options. These default values will b
103
101
// will be the same as ``httplug.client.my_guzzle5``
The bundle has client factory services that you can use to build your client. If you need a very custom made client you could create your own factory service implementing ``Http\HttplugBudle\ClientFactory\ClientFactory``. The build in services are:
104
+
The bundle has client factory services that you can use to build your client. If you need a very custom made client you could create your own factory service implementing ``Http\HttplugBudle\ClientFactory\ClientFactory``. The built-in services are:
107
105
108
106
* ``httplug.factory.curl``
109
107
* ``httplug.factory.guzzle5``
@@ -161,40 +159,40 @@ You can configure a client with authentication. Valid authentication types are `
\* *These services are always an alias to another service. You can specify your own service or leave the default, which is the same name with `.default` appended.*
193
191
194
192
195
-
Useage for Reusable Bundles
193
+
Usage for Reusable Bundles
196
194
``````````````````````````
197
195
198
-
Rather than code against specific HTTP clients, you want to use the Httplug ``Client`` interface. To avoid building your own infrastructure to define services for the client, simply ``require: php-http/httplug-bundle`` in your bundles ``composer.json``. You SHOULD provide a configuration option to specify the which HTTP client service to use for each of your services. This option should default to ``httplug.client``. This way, the default case needs no additional configuration for your users, but they have the option of using specific clients with each of your services.
196
+
Rather than code against specific HTTP clients, you want to use the HTTPlug ``Client`` interface. To avoid building your own infrastructure to define services for the client, simply ``require: php-http/httplug-bundle`` in your bundles ``composer.json``. You SHOULD provide a configuration option to specify the which HTTP client service to use for each of your services. This option should default to ``httplug.client``. This way, the default case needs no additional configuration for your users, but they have the option of using specific clients with each of your services.
199
197
200
-
The only steps they need is ``require`` one of the adapter implementations in their projects ``composer.json`` and instantiating the HttplugBundle in their kernel.
198
+
The only steps they need is ``require`` one of the adapter implementations in their projects ``composer.json`` and instantiating the ``HttplugBundle`` in their kernel.
0 commit comments