hyperf / nacos-sdk
This package is abandoned and no longer maintained.
No replacement package was suggested.
Nacos SDK
v2.2.0-rc1
2021-06-20 00:45 UTC
Requires
- php: >=7.3
- guzzlehttp/guzzle: ^6.5|^7.0
- hyperf/contract: ~2.2.0
- hyperf/utils: ~2.2.0
This package is auto-updated.
Last update: 2021-07-20 02:49:11 UTC
README
安装
composer require hyperf/nacos-sdk
使用
<?php use Hyperf\NacosSdk\Application; use Hyperf\NacosSdk\Config; use Hyperf\Utils\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());