friendsofhyperf/config-consul

The consul config component for Hyperf.

Fund package maintenance!
huangdijia
hdj.me/sponsors

Installs: 307

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

pkg:composer/friendsofhyperf/config-consul


README

Latest Stable Version Total Downloads License

The consul config component for Hyperf.

Installation

composer require friendsofhyperf/config-consul

Configure

// config/autoload/config_center.php

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

Contact

License

MIT