Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5af03c0

Browse files
committed
update doc
1 parent 4444830 commit 5af03c0

File tree

1 file changed

+9
-146
lines changed

1 file changed

+9
-146
lines changed

index.markdown

Lines changed: 9 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ providing a powerful abstraction layer for geocoding manipulations.
2525

2626
* [Installation](#installation)
2727
* [Usage](#usage)
28-
- [Address & AddressCollection](#address-&-addresscollection)
28+
- [Address & AddressCollection](#address--addresscollection)
2929
- [The ProviderAggregator](#the-provideraggregator)
3030
- [TimedGeocoder](#timedgeocoder)
3131
- [HTTP Adapters](#http-adapters)
@@ -75,7 +75,7 @@ Choose the one that fits your need first. Let's say the `GoogleMaps` one is what
7575
you were looking for, so let's see how to use it. In the code snippet below,
7676
`curl` has been choosen as [HTTP layer](#http-adapters) but it is up to you
7777
since each HTTP-based provider implements
78-
[PSR-7](https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md).
78+
[PSR-7](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md).
7979

8080
```php
8181
$curl = new \Ivory\HttpAdapter\CurlHttpAdapter();
@@ -112,12 +112,8 @@ objects (`AddressCollection`), each providing the following API:
112112
* `getLocality()` will return the `locality` or `city`;
113113
* `getPostalCode()` will return the `postalCode` or `zipcode`;
114114
* `getSubLocality()` will return the `city district`, or `sublocality`;
115-
* `getCounty()` will return a `County` object (with `name` and `code`
116-
properties);
117-
* `getCountyCode()` will return the `county` code (county short name);
118-
* `getRegion()` will return a `Region` object (with `name` and `code`
119-
properties);
120-
* `getRegionCode()` will return the `region` code (region short name);
115+
* `getAdminLevels()` will return an ordered collection (`AdminLevelCollection`)
116+
of `AdminLevel` object (with `level`, `name` and `code` properties);
121117
* `getCountry()` will return a `Country` object (with `name` and `code`
122118
properties);
123119
* `getCountryCode()` will return the ISO `country` code;
@@ -222,7 +218,7 @@ geocoder calls will appear in your timeline section in the Web Profiler.
222218
In order to talk to geocoding APIs, you need HTTP adapters. While it was part of
223219
the library in Geocoder 1.x and 2.x, Geocoder 3.x and upper now relies on the
224220
[PSR-7
225-
Standard](https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md)
221+
Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md)
226222
which defines how HTTP message should be implemented. Choose any library that
227223
follows this PSR and implement the specified interfaces to use with Geocoder.
228224

@@ -294,7 +290,8 @@ $geocoder = new \Geocoder\Provider\GoogleMaps(
294290
$httpAdapter,
295291
$locale,
296292
$region,
297-
$useSsl // true|false
293+
$useSsl, // true|false
294+
$apiKey
298295
);
299296
```
300297

@@ -483,13 +480,9 @@ Here is the mapping:
483480

484481
* Zipcode: `%z`
485482

486-
* County: `%P`
487-
488-
* County Code: `%p`
489-
490-
* Region: `%R`
483+
* Admin Level Name: `%A1`, `%A2`, `%A3`, `%A4`, `%A5`
491484

492-
* Region Code: `%r`
485+
* Admin Level Code: `%a1`, `%a2`, `%a3`, `%a4`, `%a5`
493486

494487
* Country: `%C`
495488

@@ -504,133 +497,3 @@ Extending Things
504497
You can write your own `provider` by implementing the `Provider` interface.
505498

506499
You can provide your own `dumper` by implementing the `Dumper` interface.
507-
508-
509-
Versioning
510-
----------
511-
512-
Geocoder follows [Semantic Versioning](http://semver.org/).
513-
514-
### End Of Life
515-
516-
As of December 2014, branch `1.7` is not officially supported anymore, meaning
517-
major version `1` reached end of life. Last version is:
518-
[1.7.1](https://github.com/geocoder-php/Geocoder/releases/tag/1.7.1). This
519-
branch did not receive any new fixes over the last year, and all plugins/modules
520-
require Geocoder `~2.0`.
521-
522-
### Stable Version
523-
524-
Stable version
525-
[2.0.0](https://github.com/geocoder-php/Geocoder/releases/tag/2.0.0) has been
526-
released on July 2013, and it is the only known stable major version. Branch
527-
[`2.x`](https://github.com/geocoder-php/Geocoder/tree/2.x) is used to contribute
528-
bug and/or security fixes, and that is the one you should use in order to
529-
contribute.
530-
531-
Latest version is:
532-
[2.8.1](https://github.com/geocoder-php/Geocoder/releases/tag/2.8.1).
533-
534-
**Important:** as of December 2014, this version is in a **feature freeze**
535-
state. All new features should be contributed to (upcoming) version 3.0.
536-
537-
**Important:** version 2.0.0 does not have any EOL date scheduled yet.
538-
539-
### Next Version
540-
541-
Version 3.0.0 is the next major version of Geocoder. You can take a look at the
542-
[`master`](https://github.com/geocoder-php/Geocoder/tree/master) branch in order
543-
to follow its development. That is also why it is a bad idea to require
544-
`dev-master` into your `composer.json` file.
545-
546-
Branch `2.x` is merged into `master` time to time, so that all bug/security
547-
fixes contributed to the current stable version will also appear in the next
548-
version.
549-
550-
551-
Contributing
552-
------------
553-
554-
See
555-
[`CONTRIBUTING`](https://github.com/geocoder-php/Geocoder/blob/master/CONTRIBUTING.md#contributing)
556-
file.
557-
558-
559-
Unit Tests
560-
----------
561-
562-
In order to run the test suite, install the developement dependencies:
563-
564-
```
565-
$ composer install --dev
566-
```
567-
568-
Then, run the following command:
569-
570-
```
571-
$ phpunit
572-
```
573-
574-
You'll obtain some _skipped_ unit tests due to the need of API keys.
575-
576-
Rename the `phpunit.xml.dist` file to `phpunit.xml`, then uncomment the
577-
following lines and add your own API keys:
578-
579-
``` xml
580-
<php>
581-
<!-- <server name="IPINFODB_API_KEY" value="YOUR_API_KEY" /> -->
582-
<!-- <server name="BINGMAPS_API_KEY" value="YOUR_API_KEY" /> -->
583-
<!-- <server name="GEOIPS_API_KEY" value="YOUR_API_KEY" /> -->
584-
<!-- <server name="MAXMIND_API_KEY" value="YOUR_API_KEY" /> -->
585-
<!-- <server name="GEONAMES_USERNAME" value="YOUR_USERNAME" /> -->
586-
<!-- <server name="TOMTOM_MAP_KEY" value="YOUR_MAP_KEY" /> -->
587-
<!-- <server name="GOOGLE_GEOCODING_KEY" value="YOUR_GEOCODING_KEY" /> -->
588-
<!-- <server name="OPENCAGE_API_KEY" value="YOUR_API_KEY" /> -->
589-
</php>
590-
```
591-
592-
You're done.
593-
594-
595-
Credits
596-
-------
597-
598-
* William Durand <[email protected]>
599-
* [All contributors](https://github.com/geocoder-php/Geocoder/contributors)
600-
601-
602-
Contributor Code of Conduct
603-
---------------------------
604-
605-
As contributors and maintainers of this project, we pledge to respect all people
606-
who contribute through reporting issues, posting feature requests, updating
607-
documentation, submitting pull requests or patches, and other activities.
608-
609-
We are committed to making participation in this project a harassment-free
610-
experience for everyone, regardless of level of experience, gender, gender
611-
identity and expression, sexual orientation, disability, personal appearance,
612-
body size, race, age, or religion.
613-
614-
Examples of unacceptable behavior by participants include the use of sexual
615-
language or imagery, derogatory comments or personal attacks, trolling, public
616-
or private harassment, insults, or other unprofessional conduct.
617-
618-
Project maintainers have the right and responsibility to remove, edit, or reject
619-
comments, commits, code, wiki edits, issues, and other contributions that are
620-
not aligned to this Code of Conduct. Project maintainers who do not follow the
621-
Code of Conduct may be removed from the project team.
622-
623-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
624-
reported by opening an issue or contacting one or more of the project
625-
maintainers.
626-
627-
This Code of Conduct is adapted from the [Contributor
628-
Covenant](http:contributor-covenant.org), version 1.0.0, available at
629-
[http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
630-
631-
632-
License
633-
-------
634-
635-
Geocoder is released under the MIT License. See the bundled LICENSE file for
636-
details.

0 commit comments

Comments
 (0)