rstgroup/zf-external-config-consul-provider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rstgroup/zf-external-config-consul-provider

Composer 安装命令:

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

包简介

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

README 文档

README

This library contains provider that can fetch configuration from Consul Key/Value Storage.

Installation

Require module with Composer:

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:

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:

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:

  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.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 11
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固