Skip to content

Added docs for missing factories #95

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
Mar 2, 2016
Merged
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
9 changes: 6 additions & 3 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,25 @@ You can configure your clients with default options. These default values will b
headers:
Content-Type: 'application/json'
acme:
factory: 'httplug.factory.guzzle6'
factory: 'httplug.factory.curl'
config:
base_uri: 'http://google.se/'
78: 4 #CURLOPT_CONNECTTIMEOUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use expression language for this? hm, i fear not, looks like we can only use that for the value, but not for the key. only way would be to make it a php configuration file which is bad for everything else.


.. code-block:: php

$httpClient = $this->container->get('httplug.client.my_guzzle5');
$httpClient = $this->container->get('httplug.client.acme');
$httpClient = $this->container->get('httplug.client.curl');

// will be the same as ``httplug.client.my_guzzle5``
$httpClient = $this->container->get('httplug.client');

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:

* ``httplug.factory.curl``
* ``httplug.factory.guzzle5``
* ``httplug.factory.guzzle6``
* ``httplug.factory.react``
* ``httplug.factory.socket``

Plugins
```````
Expand Down