|
1 | 1 | BazingaGeocoderBundle |
2 | 2 | ===================== |
3 | 3 |
|
4 | | -Integration of the [**Geocoder**](http://github.com/geocoder-php/Geocoder) |
5 | | -library into Symfony. |
| 4 | +Integration of the [**Geocoder**](http://github.com/geocoder-php/Geocoder) library into Symfony. |
| 5 | + |
| 6 | +Our documentation has the following sections: |
| 7 | + |
| 8 | +* [Index](index.md) (This page) |
| 9 | +* [Public services](services.md) |
| 10 | +* [Registering Your Own Provider](custom-provider.md) |
| 11 | +* [All about Cache](cache.md) |
| 12 | +* [Plugins](plugins.md) |
| 13 | +* [Doctrine support](doctrine.md) |
| 14 | + |
| 15 | +Table of contents |
| 16 | +----------------- |
6 | 17 |
|
7 | 18 | * [Installation](#installation) |
8 | 19 | * [Usage](#usage) |
9 | 20 | * [Fake local ip](#fake-local-ip) |
10 | | - * [Registering Your Own Provider](#registering-your-own-provider) |
11 | | - * [Dumpers](#dumper) |
12 | 21 | * [Cache](#cache-results) |
| 22 | + * [Dumpers](#dumper) |
13 | 23 | * [Custom HTTP clients](#custom-http-clients) |
14 | | -* [Doctrine support](Resources/doc/doctrine.md) |
15 | | -* [Public services](Resources/doc/services.md) |
16 | 24 | * [Reference Configuration](#reference-configuration) |
| 25 | +* [Backwards compatibility](#backwards-compatibility) |
17 | 26 | * [Testing](#testing) |
18 | 27 |
|
19 | 28 |
|
@@ -132,22 +141,22 @@ bazinga_geocoder: |
132 | 141 | If set, the parameter will replace all instances of "127.0.0.1" in your queries and replace them with the given one. |
133 | 142 |
|
134 | 143 |
|
135 | | -### Registering Your Own Providers |
| 144 | +### Cache Results |
136 | 145 |
|
137 | | -If you want to use your own provider in your application, create a service, |
138 | | -and tag it as `bazinga_geocoder.provider`: |
| 146 | +Sometimes you have to cache the results from a provider. For this case the bundle provides |
| 147 | +simple configuration. You only need to provide a service name for you SimpleCache (PSR-16) |
| 148 | +service and you are good to go. |
139 | 149 |
|
140 | | -```xml |
141 | | -<service id="acme_demo.geocoder.my_provider" class="Acme\Demo\Geocoder\Provider\MyProvider"> |
142 | | - <tag name="bazinga_geocoder.provider" /> |
143 | | -</service> |
| 150 | +```yaml |
| 151 | +bazinga_geocoder: |
| 152 | + providers: |
| 153 | + acme: |
| 154 | + factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory |
| 155 | + cache: 'any.psr16.service' |
| 156 | + cache_lifetime: 3600 |
144 | 157 | ``` |
145 | 158 |
|
146 | | -The bundle will automatically register your provider into the |
147 | | -`Geocoder\ProviderAggregator` service. |
148 | | - |
149 | | -If you want your provider to show up the web profiler you have to create a custom factory |
150 | | -for your provider. |
| 159 | +Read more about cache [here](cache.md). |
151 | 160 |
|
152 | 161 | ### Dumpers |
153 | 162 |
|
@@ -190,22 +199,6 @@ To register a new dumper, you must tag it with `bazinga_geocoder.dumper`. |
190 | 199 | </service> |
191 | 200 | ``` |
192 | 201 |
|
193 | | -### Cache Results |
194 | | - |
195 | | -Sometimes you have to cache the results from a provider. For this case the bundle provides |
196 | | -simple configuration. You only need to provide a service name for you SimpleCache (PSR-16) |
197 | | -service and you are good to go. |
198 | | - |
199 | | -```yaml |
200 | | -bazinga_geocoder: |
201 | | - providers: |
202 | | - acme: |
203 | | - factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory |
204 | | - cache: 'any.psr16.service' |
205 | | - cache_lifetime: 3600 |
206 | | -
|
207 | | -``` |
208 | | - |
209 | 202 | ### Custom HTTP Client |
210 | 203 |
|
211 | 204 | The HTTP geocoder providers integrates with [HTTPlug](http://httplug.io/). It will give you all |
@@ -243,6 +236,8 @@ bazinga_geocoder: |
243 | 236 | limit: 5 |
244 | 237 | locale: 'sv' |
245 | 238 | logger: 'logger' |
| 239 | + plugins: |
| 240 | + - my_custom_plugin |
246 | 241 | aliases: |
247 | 242 | - acme |
248 | 243 | - acme_geocoder |
|
0 commit comments