friendsofhyperf / confd
The confd component for Hyperf.
v3.2.0
2026-06-07 13:32 UTC
Requires
- hyperf/codec: ~3.2.0
- hyperf/collection: ~3.2.0
- hyperf/command: ~3.2.0
- hyperf/di: ~3.2.0
- hyperf/event: ~3.2.0
- hyperf/framework: ~3.2.0
- hyperf/support: ~3.2.0
Suggests
- hyperf/etcd: For etcd driver.
- hyperf/nacos: For nacos driver.
This package is auto-updated.
Last update: 2026-06-07 13:48:11 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