czan/config-consul

Hyperf 的配置扩展

1.1 2022-03-21 08:00 UTC

This package is not auto-updated.

Last update: 2024-09-23 20:38:36 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

安装

composer require czan/config-consul

配置

// config/autoload/config_center.php

return [
    'drivers' => [
        'consul' => [
            'driver' => Czan\ConfigConsul\ConsulDriver::class,
            'packer' => Hyperf\Utils\Packer\JsonPacker::class,
            'uri' => env('CONSUL_URI'),
            'namespaces' => [
                '/application',
            ],
            'mapping' => [
                // consul key => config key
                '/application/test' => 'test',
            ],
            'interval' => 5,
        ],
    ],
];