Skip to content

Commit 7881aa7

Browse files
committed
Merge branch 'release/4.0.7'
2 parents 8487330 + ed123f3 commit 7881aa7

File tree

8 files changed

+232
-129
lines changed

8 files changed

+232
-129
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.0.7] - 25 Mar 2018
6+
### Added
7+
- optional dedicated cache store.
8+
- hashed cache keys and hash collision prevention.
9+
- custom cache store configuration instructions.
10+
511
## [4.0.6] - 9 Feb 2018
612
### Added
713
- Laravel 5.6 compatibility.

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,45 @@ Further, a special note on the GoogleMaps provider: if you are using an API key,
5656
See the [Geocoder documentation](http://geocoder-php.org/Geocoder/) for a list
5757
of available adapters and providers.
5858

59+
### Dedicated Cache Store *Recommended*
60+
To implement the dedicated cache store, add another redis store entry in
61+
`config/database.php`, something like the following:
62+
```php
63+
"redis" => [
64+
// ...
65+
66+
"geocode-cache" => [ // choose an appropriate name
67+
'host' => env('REDIS_HOST', '192.168.10.10'),
68+
'password' => env('REDIS_PASSWORD', null),
69+
'port' => env('REDIS_PORT', 6379),
70+
'database' => 1, // be sure this number differs from your other redis databases
71+
],
72+
]
73+
```
74+
75+
You will also need to add an entry in `config/cache.php` to point to this redis
76+
database:
77+
```php
78+
"stores" => [
79+
// ...
80+
81+
"geocode" => [
82+
'driver' => 'redis',
83+
'connection' => 'geocode-cache',
84+
],
85+
],
86+
```
87+
88+
Finally, configure Geocoder for Laraver to use this store. Edit
89+
`config/geocoder.php`:
90+
```php
91+
"cache" => [
92+
"store" => "geocode",
93+
94+
// ...
95+
],
96+
```
97+
5998
### Providers
6099
If you are upgrading and have previously published the geocoder config file, you
61100
need to add the `cache-duration` variable, otherwise cache will be disabled

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"geocoder-php/geoip2-provider": "^4.0",
4242
"geocoder-php/maxmind-binary-provider": "^4.0",
4343
"mockery/mockery": "0.9.*",
44-
"orchestra/database": "3.6.x-dev@dev",
45-
"orchestra/testbench": "^3.6.0",
46-
"orchestra/testbench-browser-kit": "3.6.x-dev@dev",
44+
"orchestra/database": "3.6.*",
45+
"orchestra/testbench": "3.6.*",
46+
"orchestra/testbench-browser-kit": "3.6.*",
4747
"orchestra/testbench-dusk": "3.6.x-dev@dev",
4848
"php-coveralls/php-coveralls": "*",
4949
"phpunit/phpunit": "^7.0",

config/geocoder.php

+36-19
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,42 @@
66
use Http\Client\Curl\Client;
77

88
return [
9+
'cache' => [
910

10-
/*
11-
|--------------------------------------------------------------------------
12-
| Cache Duration
13-
|--------------------------------------------------------------------------
14-
|
15-
| Specify the cache duration in minutes. The default approximates a forever
16-
| cache, but there are certain issues with Laravel's forever caching
17-
| methods that prevent us from using them in this project.
18-
|
19-
| Default: 9999999 (integer)
20-
|
21-
*/
22-
'cache-duration' => 9999999,
11+
/*
12+
|-----------------------------------------------------------------------
13+
| Cache Store
14+
|-----------------------------------------------------------------------
15+
|
16+
| Specify the cache store to use for caching. The value "null" will use
17+
| the default cache store specified in /config/cache.php file.
18+
|
19+
| Default: null
20+
|
21+
*/
22+
23+
'store' => null,
24+
25+
/*
26+
|-----------------------------------------------------------------------
27+
| Cache Duration
28+
|-----------------------------------------------------------------------
29+
|
30+
| Specify the cache duration in minutes. The default approximates a
31+
| "forever" cache, but there are certain issues with Laravel's forever
32+
| caching methods that prevent us from using them in this project.
33+
|
34+
| Default: 9999999 (integer)
35+
|
36+
*/
37+
38+
'duration' => 9999999,
39+
],
2340

2441
/*
25-
|--------------------------------------------------------------------------
42+
|---------------------------------------------------------------------------
2643
| Providers
27-
|--------------------------------------------------------------------------
44+
|---------------------------------------------------------------------------
2845
|
2946
| Here you may specify any number of providers that should be used to
3047
| perform geocaching operations. The `chain` provider is special,
@@ -49,9 +66,9 @@
4966
],
5067

5168
/*
52-
|--------------------------------------------------------------------------
69+
|---------------------------------------------------------------------------
5370
| Adapter
54-
|--------------------------------------------------------------------------
71+
|---------------------------------------------------------------------------
5572
|
5673
| You can specify which PSR-7-compliant HTTP adapter you would like to use.
5774
| There are multiple options at your disposal: CURL, Guzzle, and others.
@@ -65,9 +82,9 @@
6582
'adapter' => Client::class,
6683

6784
/*
68-
|--------------------------------------------------------------------------
85+
|---------------------------------------------------------------------------
6986
| Reader
70-
|--------------------------------------------------------------------------
87+
|---------------------------------------------------------------------------
7188
|
7289
| You can specify a reader for specific providers, like GeoIp2, which
7390
| connect to a local file-database. The reader should be set to an

0 commit comments

Comments
 (0)