PHP code example of tutu-ru / lib-etcd-config

1. Go to this page and download the library: Download tutu-ru/lib-etcd-config 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/ */

    

tutu-ru / lib-etcd-config example snippets


use TutuRu\EtcdConfig\EtcdConfig;

$config = new EtcdConfig('/config/root/node');
$config->getValue('some.node');

use TutuRu\EtcdConfig\EtcdConfig;
use Cache\Adapter\Apcu\ApcuCachePool;
use Cache\Bridge\SimpleCache\SimpleCacheBridge;

$cache = new SimpleCacheBridge(new ApcuCachePool());
$config = new EtcdConfig('/config/root/node', $cache, 60);
$config->getValue('some.node');

use TutuRu\EtcdConfig\MutableEtcdConfig;

$config = new MutableEtcdConfig('/config/root/node');
$config->setValue('some.node', 'new value');

use TutuRu\EtcdConfig\EtcdConfigMutator;

$configMutator = new EtcdConfigMutator('/config/root/node');

$configMutator->init();
$configMutator->setValue('some/node', $value);