Skip to content

dcarbone/php-consul-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-consul-api

PHP client implementation for the Consul API

This library is loosely based upon the official GO client.

Composer

This lib is designed to be used with Composer

Require Entry:

{
  "dcarbone/php-consul-api": "0.2.*"
}

Usage

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.

Current Clients

More will be added as time goes on!

TODO

  • Tests
  • Parity with GO lib
  • Code cleanup

About

PHP client implementation for the Consul API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages