Skip to content

Commit 73cae67

Browse files
committed
document minium PHP version, timeout parameter
1 parent f787e9e commit 73cae67

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ There is an [Agent Skill for working with the OpenCage Geocoding API](https://gi
2727

2828
## Installation
2929

30+
Requires PHP 8.2 or newer.
31+
3032
### With Composer
3133

3234
The recommended - and easiest way - to install is via [Composer](https://getcomposer.org/).
@@ -108,8 +110,20 @@ $result = $promise->wait();
108110
print $result['results'][0]['formatted'];
109111
```
110112

113+
## Configuration
114+
115+
### Set a timeout
116+
117+
```php
118+
$geocoder = new \OpenCage\Geocoder\Geocoder('YOUR-API-KEY');
119+
$geocoder->setTimeout(5); // seconds, default is 10
120+
$result = $geocoder->geocode('82 Clerkenwell Road, London');
121+
```
122+
111123
### Set a proxy URL
112124

125+
The proxy URL must include a scheme (`http`, `https`, or `socks5`) and a host.
126+
113127
```php
114128
$geocoder = new \OpenCage\Geocoder\Geocoder('YOUR-API-KEY');
115129
$geocoder->setProxy('https://proxy.example.com:1234');

0 commit comments

Comments
 (0)