friendsofhyperf / confd
The confd component for Hyperf.
Fund package maintenance!
huangdijia
hdj.me/sponsors
Requires
- hyperf/codec: ~3.1.0
- hyperf/collection: ~3.1.0
- hyperf/command: ~3.1.0
- hyperf/di: ~3.1.0
- hyperf/event: ~3.1.0
- hyperf/framework: ~3.1.0
- hyperf/support: ~3.1.0
Suggests
- hyperf/etcd: For etcd driver.
- hyperf/nacos: For nacos driver.
- dev-main / 3.1.x-dev
- v3.1.43
- v3.1.41
- v3.1.40
- v3.1.31
- v3.1.28.1
- v3.1.27
- v3.1.17
- v3.1.16.1
- v3.1.16
- v3.1.15
- v3.1.14
- v3.1.8
- v3.1.5
- v3.1.1
- v3.1.0
- v3.1.0-rc.17
- v3.1.0-rc.4
- v3.1.0-beta.20
- v3.1.0-beta.15
- v3.1.0-beta.14
- v3.1.0-beta.9
- v3.1.0-beta.6
- v3.1.0-beta.1
- 3.0.x-dev
- v3.0.117
- v3.0.112
- v3.0.100
- v3.0.85
- v3.0.80
- v3.0.70
- v3.0.69
- v3.0.62
- v3.0.55
- v3.0.52
- v3.0.51
- v3.0.44
- v3.0.40
- v3.0.35
- v3.0.19
- v3.0.16
- v3.0.15
- v3.0.14
- v3.0.5
- v3.0.3
- v3.0.2
- v3.0.0
- v3.0.0-rc.30
- v3.0.0-rc.16
- v3.0.0-rc.9
- v3.0.0-rc.7
- v3.0.0-rc.5
- v3.0.0-rc.4
- v3.0.0-rc.3
- v3.0.0-beta35
- v3.0.0-beta34
- v3.0.0-beta33
- v3.0.0-beta32
- v3.0.0-beta31
- v3.0.0-beta30
- v3.0.0-beta29
- v3.0.0-beta28
- v3.0.0-beta27
- v3.0.0-beta26
- v1.0.0-beta2
- 1.0.0-beta1
This package is auto-updated.
Last update: 2024-10-18 01:35:54 UTC
README
The confd component for Hyperf.
Requirements
- PHP >= 8.0
- Hyperf >= 3.0
Installation
composer require friendsofhyperf/confd
composer require friendsofhyperf/etcd
# or
composer require friendsofhyperf/nacos
Command
Fetch configs from etcd/nacos and upgrade .env
.
php bin/hyperf.php confd:env
Listener
<?php namespace App\Listener; use FriendsOfHyperf\Confd\Event\ConfigChanged; use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Event\Annotation\Listener; use Hyperf\Event\Contract\ListenerInterface; #[Listener()] class ConfigChangedListener implements ListenerInterface { public function __construct(private StdoutLoggerInterface $logger) { } public function listen(): array { return [ ConfigChanged::class, ]; } public function process(object $event): void { $this->logger->warning('[confd] ConfdChanged'); // do something } }
Support
- Etcd
- Nacos
- Consul