PHP client implementation for the Consul API
This library is loosely based upon the official GO client.
This lib is designed to be used with Composer
Require Entry:
{
"dcarbone/php-consul-api": "0.2.*"
}
First, construct a Config object:
$config = new \DCarbone\PHPConsulAPI\Config(['Address' => 'address of your consul agent']);
Next, construct a Consul object:
$consul = new \DCarbone\PHPConsulAPI\Consul($config);
Once constructed, you interact with each Consul API via it's corresponding Client class:
list($kv_list, $qm, $err) = $consul->KV->keys();
if (null !== $err)
die($err);
var_dump($kv_list);
...as an example.
More will be added as time goes on!
- Tests
- Parity with GO lib
- Code cleanup