PHP code example of kachit / config-consul

1. Go to this page and download the library: Download kachit/config-consul library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kachit / config-consul example snippets



$sf = new SensioLabs\Consul\ServiceFactory(['base_uri' => 'http://consul.service.local']);
$kv = $sf->get('kv');

$reader = new Kachit\Config\Consul\Reader($kv);
$data = $reader->read('foo/bar/qwerty');