2017 © Pedro Peláez
 

library zf-external-config-consul-provider

Consul provider for rstgroup/zf-external-config-module

image

rstgroup/zf-external-config-consul-provider

Consul provider for rstgroup/zf-external-config-module

  • Wednesday, July 26, 2017
  • by rstgroup
  • Repository
  • 10 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ZF External Config - Consul Provider

This library contains provider that can fetch configuration from Consul Key/Value Storage., (*1)

Installation

Require module with Composer:, (*2)

composer require rstgroup/zf-external-config-consul-provider

Then don't forget to enable provider and define factory in the zf-config-module's section of application's configuration:, (*3)

return [
    'rst_group' => [
        'external_config' => [
            'providers' => [
                \RstGroup\ZfExternalConfigConsulProvider\ConsulConfigProvider::class,
            ],
            'service_manager' => [
                'factories' => [
                    \RstGroup\ZfExternalConfigConsulProvider\ConsulConfigProvider::class => 
                        \RstGroup\ZfExternalConfigConsulProvider\ConsulConfigProviderFactory::class
                ]
            ]
        ],
    ]
];

Configuration

Example configuration of provider might look just like this:, (*4)

return [
    'rst_group' => [
        'external_config' => [
            'consul' => [
                'prefix' => 'my-app/',
                'http_client' => [
                    'base_uri' => 'http://consul.local:8500',
                ]
            ],
        ],
    ],
];

The provider's configuration should be placed under rsr_group.external_config.consul key. There are two sections:, (*5)

  1. prefix key, which determines the base path in Consul's KV Storage. How it exactly works you can read in rstgroup/php-consul-kv-array-getter's documentation.
    If you don't provide prefix, provider will return all keys returned by Consul KV API.
  2. http_client key, which contains options passed to GuzzleHttp\Client instance. The key that should interest you is base_uri which determines the base location of Consul's API. By default it's value is http://127.0.0.1:8500.
    More information about possible options are described in Guzzle Docs and in Guzzle's repository.

The Versions

26/07 2017

dev-master

9999999-dev

Consul provider for rstgroup/zf-external-config-module

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artur Wolny

26/07 2017

1.0

1.0.0.0

Consul provider for rstgroup/zf-external-config-module

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artur Wolny