Registry and discovery
TTL, HTTP, TCP, and gRPC checks, with load balancing across healthy instances.
Consul / PHP
18 API modules, 3 high-level wrappers, synchronous and Promise entry points, six frameworks.
consul-php covers the Consul HTTP API v1, bringing service registration, discovery, the config center, KV, Session, ACL, and cluster operations into one PHP client.
The core depends only on PSR interfaces, with replaceable HTTP, cache, logging, and events; Laravel, Hyperf, webman, and three more frameworks are built in.
A registry sidekick that only eats heartbeats and never goes offline: the antenna is the health check heartbeat, the pulse line on its chest is the service status, and the badge on its belt is the ACL Token.
Heartbeat alive, service online.Registration, discovery, config, locks, and operations share one transport.
TTL, HTTP, TCP, and gRPC checks, with load balancing across healthy instances.
Blocking query long polling, fallback polling on errors, and automatic recovery.
Create, renew, and destroy sessions, using KV acquire for resource locks.
Full management of Token, Policy, Role, and AuthMethod.
Status, Operator, Snapshot, and Event modules are all present.
Built-in adapters for Laravel, Hyperf, webman, ThinkPHP, Yii2, and Yii3.
Four releases that filled in modules, native support, and framework adapters.
Adds the Yii2 application component and Yii3 DI integration, completing six framework adapters.
Deep audit fixes, API modules expanded to 18, and built-in cURL support for native PHP.
Adds a built-in cURL HTTP client and NativeService register, heartbeat, and deregister helpers.
Fixes multilingual diagram layout and fills in artisan commands and localization resources.
Click an image to enlarge.
Install first, then run a minimal example.
composer require erikwang2013/consul-phpuse Erikwang2013\Consul\Client\ConsulClient;
$client = new ConsulClient(['base_uri' => 'http://127.0.0.1:8500']);
$instances = $client->serviceDiscovery()->healthyInstances('user-service');
$dbHost = $client->configCenter()->get('app/db_host', 'localhost');Hover for a moment and its mood changes.