Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document using the sandbox #213

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ If the record is not found, a `\GeoIp2\Exception\AddressNotFoundException`
is thrown. If the database is invalid or corrupt, a
`\MaxMind\Db\InvalidDatabaseException` will be thrown.

See the API documentation for more details.
See the [API documentation](https://maxmind.github.io/GeoIP2-php/) for more
details.

### City Example ###

Expand Down Expand Up @@ -293,6 +294,13 @@ service:
$client = new Client(42, 'abcdef123456', ['en'], ['host' => 'geolite.info']);
```

To call the Sandbox GeoIP2 web service instead of the production GeoIP2 web
service:

```php
$client = new Client(42, 'abcdef123456', ['en'], ['host' => 'sandbox.maxmind.com']);
```

After creating the client, you may now call the method corresponding to a
specific endpoint with the IP address to look up, e.g.:

Expand All @@ -306,7 +314,8 @@ of which represents part of the data returned by the web service.

If there is an error, a structured exception is thrown.

See the API documentation for more details.
See the [API documentation](https://maxmind.github.io/GeoIP2-php/) for more
details.

### Example ###

Expand All @@ -319,7 +328,9 @@ use GeoIp2\WebService\Client;
// Replace "42" with your account ID and "license_key" with your license
// key. Set the "host" to "geolite.info" in the fourth argument options
// array to use the GeoLite2 web service instead of the GeoIP2 web
// service.
// service. Set the "host" to "sandbox.maxmind.com" in the fourth argument
// options array to use the Sandbox GeoIP2 web service instead of the
// production GeoIP2 web service.
$client = new Client(42, 'abcdef123456');

// Replace "city" with the method corresponding to the web service that
Expand Down
7 changes: 6 additions & 1 deletion src/WebService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ class Client implements ProviderInterface
* * `host` - The host to use when querying the web
* service. To query the GeoLite2 web service
* instead of the GeoIP2 web service, set the
* host to `geolite.info`.
* host to `geolite.info`. To query the Sandbox
* GeoIP2 web service instead of the production
* GeoIP2 web service, set the host to
* `sandbox.maxmind.com`. The sandbox allows you to
* experiment with the API without affecting your
* production data.
* * `timeout` - Timeout in seconds.
* * `connectTimeout` - Initial connection timeout in seconds.
* * `proxy` - The HTTP proxy to use. May include a schema, port,
Expand Down