Updated docs for the bundle #94
Conversation
|
Not sure if putting full config on a separate page is a good idea. |
|
Okey, I thought the page would be too long otherwise. I move it. I have a question about "integration with other bundles". I do not agree with what our documentation says. That will not allow a user to change client in an easy way. I've done like this in a few projects: https://github.com/Happyr/TranslationBundle#default-configuration But Im not sure that is a good best practice either. |
|
Well, can be a separate page, but in a deeper level then. Other integrations might be in this section as well. integration with other bundles? Where is it? |
|
What I did was a copy paste from the bundle README. Doesn't mean we cannot write better documentation. |
|
I started php-http/HttplugBundle#58 for this discussion. |
|
i am +1 for having a separate configuration reference page that is not part of the documentation. the reference must list each option and its meanings. the other page should explain the common use cases. those two things are different. |
|
|
||
| Install the Httplug bundle with composer and enabled it in your AppKernel.php. |
dbu
Mar 1, 2016
Contributor
s/enabled/enable
s/enabled/enable
| acme: | ||
| factory: 'httplug.factory.guzzle6' | ||
| plugins: ['httplug.plugin.logger'] | ||
| config: |
dbu
Mar 1, 2016
Contributor
if we have nothing in config, we should omit this line. or add the no ssl very thing or timeout, if we want to illustrate its possible to configure guzzle.
if we have nothing in config, we should omit this line. or add the no ssl very thing or timeout, if we want to illustrate its possible to configure guzzle.
|
|
||
| By default we use Puli to auto discover factories. If you do not want to use auto discovery you could use the following configuration (Guzzle): | ||
| 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. |
dbu
Mar 1, 2016
Contributor
missing comma after HttplugBundle
missing comma after HttplugBundle
| By default we use Puli to auto discover factories. If you do not want to use auto discovery you could use the following configuration (Guzzle): | ||
| 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. | ||
|
|
||
| Discovery of factory classes |
dbu
Mar 1, 2016
Contributor
upper case for titles: "Discovery of Factory Classes"
upper case for titles: "Discovery of Factory Classes"
| Discovery of factory classes | ||
| ```````````````````````````` | ||
|
|
||
| If you want to automatically find our factory classes you should install and enabled ``puli/symfony-bundle``. If you do not want use auto discovery you should specify all the factory classes for you client. The following example show how you configure factory classes using Guzzle. |
dbu
Mar 1, 2016
Contributor
be more assertive here:
If you want the bundle to automatically find usable factory classes, install and enable puli/symfony-bundle. If you do not want use auto discovery, you need to specify all the factory classes for you client. The following example show how you configure factory classes using Guzzle:
be more assertive here:
If you want the bundle to automatically find usable factory classes, install and enable puli/symfony-bundle. If you do not want use auto discovery, you need to specify all the factory classes for you client. The following example show how you configure factory classes using Guzzle:
|
|
||
| This page shows an example of all configuration values provided by the bundle. | ||
|
|
||
| .. code-block:: yaml |
dbu
Mar 1, 2016
Contributor
it would be great to eventually write this as full reference for the configuration, see http://symfony.com/doc/master/cmf/bundles/core/configuration.html for an example
(but lets merge what we have first)
it would be great to eventually write this as full reference for the configuration, see http://symfony.com/doc/master/cmf/bundles/core/configuration.html for an example
(but lets merge what we have first)
Nyholm
Mar 1, 2016
Author
Member
I thought I did :s
What is missing?
I thought I did :s
What is missing?
dbu
Mar 1, 2016
Contributor
this is a complete example as far as i can see. but not a reference. we dont explain each option and what you can do. we just show examples and let users deduce that eg they see all authentication methods
this is a complete example as far as i can see. but not a reference. we dont explain each option and what you can do. we just show examples and let users deduce that eg they see all authentication methods
Nyholm
Mar 1, 2016
Author
Member
I see, thanks
I see, thanks
| ```````````````````````````````````` | ||
| Web debug toolbar | ||
| ````````````````` | ||
| .. image:: assets/img/debug-toolbar.png |
dbu
Mar 1, 2016
Contributor
the travis output looks like this path is treated relative. we need to make it absolute i guess
the travis output looks like this path is treated relative. we need to make it absolute i guess
Nyholm
Mar 1, 2016
Author
Member
Thanks, I could not figure that out.. Im new to this format and was unable to run sphinx-build on my os x
Thanks, I could not figure that out.. Im new to this format and was unable to run sphinx-build on my os x
| @@ -80,10 +66,11 @@ By default we use Puli to auto discover factories. If you do not want to use aut | |||
| stream_factory: Http\Message\StreamFactory\GuzzleStreamFactory | |||
| Configure your client | |||
dbu
Mar 1, 2016
Contributor
"Configure Clients"
(and all non-glue words in titel are capitalized)
"Configure Clients"
(and all non-glue words in titel are capitalized)
| logger: ~ | ||
| clients: | ||
| acme: | ||
| factory: 'httplug.factory.guzzle6' |
dbu
Mar 1, 2016
Contributor
we should explain where this factory comes from and how to know its name
we should explain where this factory comes from and how to know its name
| @@ -167,6 +147,39 @@ Authentication | |||
| plugins: ['httplug.plugin.authentication.my_wsse'] | |||
| List of services | |||
dbu
Mar 1, 2016
Contributor
s/services/Services/
s/services/Services/
| +----------------------------------+---------------------------------------------------------------------+ | ||
| | | httplug.plugin.content_length | | These are plugins that are enabled by default. | | ||
| | | httplug.plugin.decoder | | These services are not public and may only be used when configure | | ||
| | | httplug.plugin.error | | HttpClients or other services. | |
dbu
Mar 1, 2016
Contributor
These services are not public and can only be used to configure
(its not may, private services are just not available after the container is build. "when configure" is not correct, it would be "when configuring", but "to configure" is active and thus easier to understand)
These services are not public and can only be used to configure
(its not may, private services are just not available after the container is build. "when configure" is not correct, it would be "when configuring", but "to configure" is active and thus easier to understand)
| | | httplug.plugin.cache | | These are plugins that are disabled by default. | | ||
| | | httplug.plugin.cookie | | They need to be configured before they can be used. | | ||
| | | httplug.plugin.history | | These services are not public and may only be used when configure | | ||
| | | | HttpClients or other services. | |
dbu
Mar 1, 2016
Contributor
s/HttpClients/clients/
same above - and same question about phrasing as above.
s/HttpClients/clients/
same above - and same question about phrasing as above.
| | | | HttpClients or other services. | | ||
| +----------------------------------+---------------------------------------------------------------------+ | ||
|
|
||
| \* *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. The default services in turn use the service discovery mechanism to provide the best available implementation. You can specify a class for each of the default services to use instead of discovery, as long as those classes can be instantiated without arguments.* |
dbu
Mar 1, 2016
Contributor
s/discovery/puli/ ?
s/discovery/puli/ ?
| | | httplug.plugin.stopwatch | | | ||
| +----------------------------------+---------------------------------------------------------------------+ | ||
| | | httplug.plugin.cache | | These are plugins that are disabled by default. | | ||
| | | httplug.plugin.cookie | | They need to be configured before they can be used. | |
dbu
Mar 1, 2016
Contributor
"These are plugins that are disabled by default and only get activated when configured."
"These are plugins that are disabled by default and only get activated when configured."
| | httplug.client.[name] | | This is your HttpClient that you have configured. | | ||
| | | | With the configuration below the name would be `acme_client`. | | ||
| +----------------------------------+---------------------------------------------------------------------+ | ||
| | httplug.client | This is the first client configured or a client named `default`. | |
dbu
Mar 1, 2016
Contributor
If there is a client named "default", this service is an alias to that client, otherwise it is an alias to the first client configured.
If there is a client named "default", this service is an alias to that client, otherwise it is an alias to the first client configured.
| +----------------------------------+---------------------------------------------------------------------+ | ||
| | httplug.stream_factory | Service* that provides the `Http\Message\StreamFactory` | | ||
| +----------------------------------+---------------------------------------------------------------------+ | ||
| | httplug.client.[name] | | This is your HttpClient that you have configured. | |
dbu
Mar 1, 2016
Contributor
There is one service per named client.
There is one service per named client.
| factory: 'httplug.factory.guzzle6' | ||
| plugins: ['httplug.plugin.authentication.my_wsse', 'httplug.plugin.cache', 'httplug.plugin.retry'] | ||
| config: | ||
| base_uri: 'http://google.se/' |
dbu
Mar 1, 2016
Contributor
lets configure the timeout instead, base uri should be handled by the php-http plugin
lets configure the timeout instead, base uri should be handled by the php-http plugin
|
cool. lets wrap this up asap and then merge. |
|
Wow, cool thing @dbu. Wanna do the fixes yourself? |
|
i might find a moment tomorrow if tobias does not have the time |
|
Sorry, read your comments now. Im doing some fixes now. |
|
This PR is ready to be merged into #93 |
Updated docs for the bundle
eacd0af
into
php-http:symfony_bundle
No description provided.