★ wanayoo — archive 1999 https://github.com/php-http/documentation/pull/94Nouvelle recherche | Portail wanayoo
Skip to content
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

Updated docs for the bundle #94

Merged
merged 1 commit into from Mar 1, 2016

Conversation

@Nyholm
Copy link
Member

@Nyholm Nyholm commented Feb 29, 2016

No description provided.

@Nyholm Nyholm force-pushed the Nyholm:symfony_bundle_2 branch from b594d56 to b8971bd Feb 29, 2016
@sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark commented Mar 1, 2016

Not sure if putting full config on a separate page is a good idea.

@Nyholm
Copy link
Member Author

@Nyholm Nyholm commented Mar 1, 2016

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.

@sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark commented Mar 1, 2016

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?

@sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark commented Mar 1, 2016

What I did was a copy paste from the bundle README. Doesn't mean we cannot write better documentation. 😉

@Nyholm
Copy link
Member Author

@Nyholm Nyholm commented Mar 1, 2016

I started php-http/HttplugBundle#58 for this discussion.

@dbu
Copy link
Contributor

@dbu dbu commented Mar 1, 2016

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.

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

s/enabled/enable

acme:
factory: 'httplug.factory.guzzle6'
plugins: ['httplug.plugin.logger']
config:

This comment has been minimized.

@dbu

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.


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.

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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.

This comment has been minimized.

@dbu

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:


This page shows an example of all configuration values provided by the bundle.

.. code-block:: yaml

This comment has been minimized.

@dbu

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)

This comment has been minimized.

@Nyholm

Nyholm Mar 1, 2016
Author Member

I thought I did :s

What is missing?

This comment has been minimized.

@dbu

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 comment has been minimized.

@Nyholm

Nyholm Mar 1, 2016
Author Member

I see, thanks

````````````````````````````````````
Web debug toolbar
`````````````````
.. image:: assets/img/debug-toolbar.png

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

the travis output looks like this path is treated relative. we need to make it absolute i guess

This comment has been minimized.

@Nyholm

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

@@ -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

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

"Configure Clients"

(and all non-glue words in titel are capitalized)

logger: ~
clients:
acme:
factory: 'httplug.factory.guzzle6'

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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. |

This comment has been minimized.

@dbu

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)

| | 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. |

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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.*

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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. |

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

"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`. |

This comment has been minimized.

@dbu

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.

+----------------------------------+---------------------------------------------------------------------+
| httplug.stream_factory | Service* that provides the `Http\Message\StreamFactory` |
+----------------------------------+---------------------------------------------------------------------+
| httplug.client.[name] | | This is your HttpClient that you have configured. |

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

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/'

This comment has been minimized.

@dbu

dbu Mar 1, 2016
Contributor

lets configure the timeout instead, base uri should be handled by the php-http plugin

@dbu
Copy link
Contributor

@dbu dbu commented Mar 1, 2016

cool. lets wrap this up asap and then merge.

@sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark commented Mar 1, 2016

Wow, cool thing @dbu. Wanna do the fixes yourself?

@dbu
Copy link
Contributor

@dbu dbu commented Mar 1, 2016

i might find a moment tomorrow if tobias does not have the time

@Nyholm
Copy link
Member Author

@Nyholm Nyholm commented Mar 1, 2016

Sorry, read your comments now. Im doing some fixes now.

@Nyholm Nyholm force-pushed the Nyholm:symfony_bundle_2 branch from 00e8328 to 5845636 Mar 1, 2016
@Nyholm
Copy link
Member Author

@Nyholm Nyholm commented Mar 1, 2016

This PR is ready to be merged into #93

sagikazarmark added a commit that referenced this pull request Mar 1, 2016
Updated docs for the bundle
@sagikazarmark sagikazarmark merged commit eacd0af into php-http:symfony_bundle Mar 1, 2016
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.