@@ -26,22 +26,20 @@ $ composer require ivory/google-map-bundle
2626If you want to use the [ Direction] ( /Resources/doc/service/direction.md ) ,
2727[ Distance Matrix] ( /Resources/doc/service/distance_matrix.md ) , [ Elevation] ( /Resources/doc/service/elevation.md ) ,
2828[ Geocoder] ( /Resources/doc/service/geocoder.md ) , [ Place] ( /Resources/doc/service/place/index.md ) or
29- [ Time Zone] ( /Resources/doc/service/time_zone.md ) services, you will need an http client and message factory via
30- [ Httplug] ( https://httplug.io/ ) which is an http client abstraction library as well as the
31- [ Ivory Serializer] ( https://github.com/egeloen/ivory-serializer ) which is an advanced (de)-serialization library.
29+ [ Time Zone] ( /Resources/doc/service/time_zone.md ) services, you will need an http client and message factory via
30+ [ Httplug] ( https://httplug.io/ ) which is an http client abstraction library as well as the
31+ [ Ivory Serializer] ( https://github.com/egeloen/ivory-serializer ) which is an advanced (de)-serialization library.
3232
33- [ Httplug] ( https://httplug.io/ ) and [ Ivory Serializer] ( https://github.com/egeloen/ivory-serializer ) provide bundles, so
34- let's install them to ease our life:
33+ The simplest implementation of PSR compatible libraries is using Symfony's [ HttpClient] ( https://github.com/symfony/http-client )
34+ and a lightweight [ PSR-7 library] ( https://github.com/Nyholm/psr7 ) by [ Tobias Nyholm] ( https://github.com/Nyholm ) .
35+ Next to that use the [ Ivory Serializer] ( https://github.com/egeloen/ivory-serializer ) bundle, so let's install them to ease our life:
3536
3637``` bash
3738$ composer require egeloen/serializer-bundle
38- $ composer require php-http/guzzle7-adapter
39- $ composer require php-http/httplug-bundle
39+ $ composer require symfony/http-client
40+ $ composer require nyholm/psr7
4041```
4142
42- Here, I have chosen to use [ Guzzle7] ( https://docs.guzzlephp.org/en/latest/psr7.html ) but since Httplug supports the
43- most popular http clients, you can install your preferred one instead.
44-
4543## Register the bundle
4644
4745Then, add the bundle in your ` AppKernel ` :
@@ -57,7 +55,13 @@ public function registerBundles()
5755
5856 // Optionally
5957 new Ivory\SerializerBundle\IvorySerializerBundle(),
60- new Http\HttplugBundle\HttplugBundle(),
6158 ];
6259}
6360```
61+
62+ When using the [ FrameworkBundle] ( ) you will have the Client service available under ` http_client ` . Otherwise you would
63+ need to create a service definition for the ` Symfony\Component\HttpClient\Psr18Client ` class and use that in the following
64+ Google service definitions in this bundle.
65+
66+ The request factory implementation will be available as ` nyholm.psr7.psr17_factory ` when you use Symfony Flex in your
67+ project. If not you must add a service definitionfor ` Nyholm\Psr7\Factory\Psr17Factory ` to be able to complete the configuration.
0 commit comments