Skip to content

Commit 11c80da

Browse files
committed
prepping for v7 release
1 parent c81793c commit 11c80da

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Require Entry:
3434
## Configuration
3535

3636
First, construct a [Config](./src/Config.php). This class is modeled quite closely after the
37-
[Config Struct](https://github.com/hashicorp/consul/blob/v1.0.0/api/api.go#L202) present in the
38-
[Consul API Subpackage](https://github.com/hashicorp/consul/blob/v1.0.0/api).
37+
[Config Struct](https://github.com/hashicorp/consul/blob/v1.9.3/api/api.go#L280) present in the
38+
[Consul API Subpackage](https://github.com/hashicorp/consul/blob/v1.9.3/api).
3939

4040
### Default Configuration
4141

@@ -58,19 +58,21 @@ $config = new \DCarbone\PHPConsulAPI\Config([
5858
'Scheme' => 'http or https', // [optional] defaults to "http"
5959
'Datacenter' => 'name of datacenter', // [optional]
6060
'HttpAuth' => 'user:pass', // [optional]
61+
'WaitTime' => '0s', // [optional] amount of time to wait on certain blockable endpoints. go time duration string format.
6162
'Token' => 'auth token', // [optional] default auth token to use
6263
'TokenFile' => 'file with auth token', // [optional] file containing auth token string
6364
'InsecureSkipVerify' => false, // [optional] if set to true, ignores all SSL validation
6465
'CAFile' => '', // [optional] path to ca cert file, see http://docs.guzzlephp.org/en/latest/request-options.html#verify
6566
'CertFile' => '', // [optional] path to client public key. if set, requires KeyFile also be set
6667
'KeyFile' => '', // [optional] path to client private key. if set, requires CertFile also be set
68+
'JSONEncodeOpts'=> 0, // [optional] php json encode opt value to use when serializing requests
6769
]);
6870
```
6971

7072
#### Configuration Note:
7173

7274
By default, this client will attempt to locate a series of environment variables to describe much of the above
73-
configuration properties. See [here](./src/Config.php#L450) for that list, and see [here](./src/Consul.php#L96) for
75+
configuration properties. See [here](./src/Config.php#L559) for that list, and see [here](./src/Consul.php#L40) for
7476
a list of the env var names.
7577

7678
For more advanced client configuration, such as proxy configuration, you must construct your own GuzzleHttp client
@@ -97,17 +99,17 @@ Next, construct a [Consul](./src/Consul.php) object:
9799
$consul = new \DCarbone\PHPConsulAPI\Consul($config);
98100
```
99101

100-
*NOTE*: If you do not create your own config object, [Consul](./src/Consul.php#L78) will create it's own
101-
using [Config::newDefaultConfig()](./src/Config.php#L147) and attempt to locate a suitable HTTP Client.
102+
*NOTE*: If you do not create your own config object, [Consul](./src/Consul.php#L171) will create it's own
103+
using [Config::newDefaultConfig()](./src/Config.php#L253) and attempt to locate a suitable HTTP Client.
102104

103105
Once constructed, you interact with each Consul API via it's corresponding Client class:
104106

105107
```php
106-
list($kv_list, $qm, $err) = $consul->KV->keys();
107-
if (null !== $err)
108-
die($err);
108+
$kvResp = $consul->KV->Keys();
109+
if (null !== $kvResp->Err)
110+
die($kvResp->Err);
109111

110-
var_dump($kv_list);
112+
var_dump($kvResp->Value);
111113
```
112114

113115
...as an example.

src/Consul.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,17 @@ public function __construct(Config $config = null)
185185
}
186186
}
187187

188-
$this->ACL = new ACLClient($config);
189-
$this->Agent = new AgentClient($config);
190-
$this->Catalog = new CatalogClient($config);
191-
$this->Coordinate = new CoordinateClient($config);
192-
$this->Event = new EventClient($config);
193-
$this->Health = new HealthClient($config);
194-
$this->KV = new KVClient($config);
195-
$this->Operator = new OperatorClient($config);
188+
$this->ACL = new ACLClient($config);
189+
$this->Agent = new AgentClient($config);
190+
$this->Catalog = new CatalogClient($config);
191+
$this->Coordinate = new CoordinateClient($config);
192+
$this->Event = new EventClient($config);
193+
$this->Health = new HealthClient($config);
194+
$this->KV = new KVClient($config);
195+
$this->Operator = new OperatorClient($config);
196196
$this->PreparedQuery = new PreparedQueryClient($config);
197-
$this->Session = new SessionClient($config);
198-
$this->Status = new StatusClient($config);
197+
$this->Session = new SessionClient($config);
198+
$this->Status = new StatusClient($config);
199199
}
200200

201201
/**

0 commit comments

Comments
 (0)