zhourenjie / php-nacos-client
this is php nacos client
v1.0.4
2023-10-21 09:31 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ~6.0
README
安装下面composer包
composer require zhourenjie/php-nacos-client
<?php use PhpHelper\NacosSdk\Application; use PhpHelper\NacosSdk\Config; $application = new Application(new Config([ 'username' => 'nacos', 'password' => 'nacos', 'guzzle_config' => [ 'headers' => [ 'charset' => 'UTF-8', ], ], ])); $response = $application->auth->login('nacos', 'nacos'); $result = json_decode($response->getBody(),true); $response = $application->config->get('hyperf-service-config', 'DEFAULT_GROUP'); $result = json_decode($response->getBody(),true); //具体请看nacos官网 open api设计 @link(https://nacos.io/zh-cn/docs/open-api.html)