Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7642c0f

Browse files
committed
Updated readme and changelog
1 parent8022fe7 commit7642c0f

File tree

3 files changed

+48
-22
lines changed

3 files changed

+48
-22
lines changed

‎CHANGELOG.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
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.0] - 3 Aug 2017
6+
###Fixed
7+
- typo which caused cache to be in-effective.
8+
9+
###Changed
10+
- version to 4.0.0 instead of 2.0.0 to maintain major version parity with
11+
parent package.
12+
- composer dependencies to release versions.
13+
- unit tests to pass.
14+
- updated readme with some clarifying notes. May have to completely rewrite it
15+
if it ends up being unclear.
16+
517
##[2.0.0-dev] - 23 Jun 2017
618
###Fixed
719
- failing Travis builds due TLS resolution issues by changing to a different
820
geocoding provider that was failing said resolution during CURL requests.
9-
21+
1022
###Changed
1123
- build and coverage badges back to Travis and Coveralls
1224

‎README.md‎

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>If you still use**Laravel 4**, please check out the`0.4.x` branch
1111
[here](https://github.com/geocoder-php/GeocoderLaravel/tree/0.4.x).
1212

13-
**Version2.0.0 is a backwards-compatibility-breaking update. Please review
13+
**Version4.0.0 is a backwards-compatibility-breaking update. Please review
1414
this documentation, especially the_Usage_ section before installing.**
1515

1616
This package allows you to use[**Geocoder**](http://geocoder-php.org/Geocoder/)
@@ -26,18 +26,18 @@ This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/)
2626
composer require toin0u/geocoder-laravel
2727
```
2828

29-
2. Find the`providers` array key in`config/app.php` and register the**Geocoder Service Provider**:
29+
2.**If you are running Laravel 5.5, skip this step.**Find the`providers` array key in`config/app.php` and register the**Geocoder Service Provider**:
3030
```php
3131
// 'providers' => [
3232
Geocoder\Laravel\Providers\GeocoderService::class,
3333
// ];
3434
```
3535

3636
##Upgrading
37-
###1.x to2.x
37+
###1.x to4.x
3838
Update your composer.json file:
3939
```json
40-
"toin0u/geocoder-laravel":"^2.0",
40+
"toin0u/geocoder-laravel":"^4.0",
4141
```
4242

4343
The one change to keep in mind here is that the results returned from
@@ -108,19 +108,22 @@ Further, a special note on the GoogleMaps provider: if you are using an API key,
108108
See the [Geocoder documentation](http://geocoder-php.org/Geocoder/) for a list
109109
of available adapters and providers.
110110

111-
### Default Settings
112-
If you are upgrading and do not update your config file with the `cache-duraction`
113-
variable, cache will by default be disabled (it will have a `0` cache duration).
114-
The default cache duration provided by the config file is `999999999` minutes,
115-
essentially forever.
116-
117-
By default, the configuration specifies a Chain Provider as the first provider,
118-
containing GoogleMaps and FreeGeoIp providers. The first to return a result
119-
will be returned. After the Chain Provider, we have added the BingMaps provider
120-
for use in specific situations (providers contained in the Chain provider will
121-
be run by default, providers not in the Chain provider need to be called
122-
explicitly). The second GoogleMaps Provider outside of the Chain Provider is
123-
there just to illustrate this point (and is used by the PHPUnit tests).
111+
### Configuration
112+
#### Providers
113+
If you are upgrading and have previously published the geocoder config file, you
114+
need to add the `cache-duration` variable, otherwise cache will be disabled
115+
(it will default to a `0` cache duration). The default cache duration provided
116+
by the config file is `999999999` minutes, essentially forever.
117+
118+
By default, the configuration specifies a Chain provider, containing the
119+
GoogleMaps provider for addresses as well as reverse lookups with lat/long,
120+
and the GeoIP provider for IP addresses. The first to return a result
121+
will be returned, and subsequent providers will not be executed. The default
122+
config file is kept lean with only those two providers.
123+
124+
However, you are free to add or remove providers as needed, both inside the
125+
Chain provider, as well as along-side it. The following is an example config
126+
with additional providers we use for testing:
124127
```php
125128
use Http\Client\Curl\Client;
126129
use Geocoder\Provider\BingMaps\BingMaps;
@@ -129,7 +132,7 @@ use Geocoder\Provider\FreeGeoIp\FreeGeoIp;
129132
use Geocoder\Provider\GoogleMaps\GoogleMaps;
130133

131134
return [
132-
'cache-duraction' => 999999999,
135+
'cache-duration' => 999999999,
133136
'providers' => [
134137
Chain::class => [
135138
GoogleMaps::class => [
@@ -151,6 +154,13 @@ return [
151154
];
152155
```
153156

157+
####Adapters
158+
By default we provide a CURL adapter to get you running out of the box.
159+
However, if you have already installed Guzzle or any other PSR-7-compatible
160+
HTTP adapter, you are encouraged to replace the CURL adapter with it. Please
161+
see the[Geocoder Documentation](https://github.com/geocoder-php/Geocoder) for
162+
specific implementation details.
163+
154164
###Customization
155165
If you would like to make changes to the default configuration, publish and
156166
edit the configuration file:
@@ -168,6 +178,11 @@ The service provider initializes the `geocoder` service, accessible via the
168178
app('geocoder')->geocode('Los Angeles, CA')->get();
169179
```
170180

181+
####Get IP Address Information
182+
```php
183+
app('geocoder')->geocode('8.8.8.8')->get();
184+
```
185+
171186
####Reverse-Geocoding
172187
```php
173188
app('geocoder')->reverse(43.882587,-103.454067)->get();
@@ -193,4 +208,4 @@ Please note that this project is released with a
193208
##License
194209
GeocoderLaravel is released under the MIT License. See the bundled
195210
[LICENSE](https://github.com/geocoder-php/GeocoderLaravel/blob/master/LICENSE)
196-
file for details.
211+
file for details.

‎config/geocoder.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
* file that was distributed with this source code.
77
*/
88

9-
useHttp\Client\Curl\Client;
10-
useGeocoder\Provider\BingMaps\BingMaps;
119
useGeocoder\Provider\Chain\Chain;
1210
useGeocoder\Provider\GeoPlugin\GeoPlugin;
1311
useGeocoder\Provider\GoogleMaps\GoogleMaps;
12+
useHttp\Client\Curl\Client;
1413

1514
return [
1615
'cache-duration' =>999999999,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp