czan/config-consul

Config extension for Hyperf.

1.1 2022-03-21 08:00 UTC

This package is not auto-updated.

Last update: 2022-09-26 11:18:42 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

Installation

composer require czan/config-consul

Configure

// 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,
        ],
    ],
];