hyperf / nacos
Nacos SDK
v3.2.0
2026-06-07 09:04 UTC
Requires
- php: >=8.2
- guzzlehttp/guzzle: ^7.0
- hyperf/codec: ~3.2.0
- hyperf/collection: ~3.2.0
- hyperf/context: ~3.2.0
- hyperf/contract: ~3.2.0
- hyperf/coordinator: ~3.2.0
- hyperf/engine: ^2.0
- hyperf/support: ~3.2.0
- jetbrains/phpstorm-attributes: ^1.0
This package is auto-updated.
Last update: 2026-06-07 09:30:16 UTC
README
安装
composer require hyperf/nacos
使用
<?php use Hyperf\Nacos\Application; use Hyperf\Nacos\Config; use Hyperf\Codec\Json; $application = new Application(new Config([ 'username' => 'nacos', 'password' => 'nacos', 'guzzle_config' => [ 'headers' => [ 'charset' => 'UTF-8', ], ], ])); $response = $application->auth->login('nacos', 'nacos'); $result = Json::decode((string) $response->getBody()); $response = $application->config->get('hyperf-service-config', 'DEFAULT_GROUP'); $result = Json::decode((string) $response->getBody());