friendsofhyperf/config-consul

Config extension for Hyperf.

1.0.0 2021-07-20 07:25 UTC

This package is auto-updated.

Last update: 2021-12-20 08:19:58 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

Installation

composer require friendsofhyperf/config-consul

Configure

// config/autoload/config_center.php

return [
    'drivers' => [
        'consul' => [
            'driver' => FriendsOfHyperf\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,
        ],
    ],
];