Skip to content

Commit 480e352

Browse files
committed
bit of readme update
1 parent cc0831e commit 480e352

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This library is loosely based upon the [official GO client](https://github.com/h
1414
| 0.6.x | 0.7-0.8 |
1515
| v1.x | 0.9-current |
1616
| v2.x | 0.9-current |
17+
| v3.x | 0.9-current |
1718
| dev-main | current |
1819

1920
Newer versions of the api lib will probably work in a limited capacity with older versions of Consul, but no guarantee
@@ -28,7 +29,7 @@ Require Entry:
2829
```json
2930
{
3031
"require": {
31-
"dcarbone/php-consul-api": "^v2.0"
32+
"dcarbone/php-consul-api": "^v3.0"
3233
}
3334
}
3435
```
@@ -53,22 +54,28 @@ $config = \DCarbone\PHPConsulAPI\Config::newDefaultConfig();
5354
You may alternatively define values yourself:
5455

5556
```php
56-
$config = new \DCarbone\PHPConsulAPI\Config([
57-
'HttpClient' => $client, // [required] Client conforming to GuzzleHttp\ClientInterface
58-
'Address' => 'address of server', // [required]
59-
60-
'Scheme' => 'http or https', // [optional] defaults to "http"
61-
'Datacenter' => 'name of datacenter', // [optional]
62-
'HttpAuth' => 'user:pass', // [optional]
63-
'WaitTime' => '0s', // [optional] amount of time to wait on certain blockable endpoints. go time duration string format.
64-
'Token' => 'auth token', // [optional] default auth token to use
65-
'TokenFile' => 'file with auth token', // [optional] file containing auth token string
66-
'InsecureSkipVerify' => false, // [optional] if set to true, ignores all SSL validation
67-
'CAFile' => '', // [optional] path to ca cert file, see http://docs.guzzlephp.org/en/latest/request-options.html#verify
68-
'CertFile' => '', // [optional] path to client public key. if set, requires KeyFile also be set
69-
'KeyFile' => '', // [optional] path to client private key. if set, requires CertFile also be set
70-
'JSONEncodeOpts'=> 0, // [optional] php json encode opt value to use when serializing requests
71-
]);
57+
$config = new \DCarbone\PHPConsulAPI\Config(
58+
// required fields
59+
HttpClient: $client, // [required] Client conforming to GuzzleHttp\ClientInterface
60+
Address: 'address of server', // [required]
61+
62+
// optional fields
63+
Scheme: 'http or https', // [optional] defaults to "http"
64+
Datacenter: 'name of datacenter', // [optional]
65+
HttpAuth: 'user:pass', // [optional]
66+
WaitTime: '0s', // [optional] amount of time to wait on certain blockable endpoints. go time duration string format.
67+
Token: 'auth token', // [optional] default auth token to use
68+
TokenFile: 'file with auth token', // [optional] file containing auth token string
69+
InsecureSkipVerify: false, // [optional] if set to true, ignores all SSL validation
70+
CAFile: '', // [optional] path to ca cert file, see http://docs.guzzlephp.org/en/latest/request-options.html#verify
71+
CertFile: '', // [optional] path to client public key. if set, requires KeyFile also be set
72+
KeyFile: '', // [optional] path to client private key. if set, requires CertFile also be set
73+
74+
// php specific options
75+
JSONEncodeOpts: JSON_UNESCAPED_SLASHES,
76+
JSONDecodeMaxDepth: 512,
77+
JSONDecodeOpts: 0,
78+
);
7279
```
7380

7481
#### Configuration Note:
@@ -84,10 +91,10 @@ As an example:
8491

8592
```php
8693
$proxyClient = new \GuzzleHttp\Client(['proxy' => 'whatever proxy you want']]);
87-
$config = new \DCarbone\PHPConsulAPI\Config([
88-
'HttpClient' => $proxyClient,
89-
'Address' => 'address of server',
90-
]);
94+
$config = new \DCarbone\PHPConsulAPI\Config(
95+
HttpClient: $proxyClient,
96+
Address: 'address of server',
97+
);
9198
```
9299

93100
When constructing your client, if you are using the `GuzzleHttp\Client` object directly or derivative thereof, you may

0 commit comments

Comments
 (0)