hyperf / nacos-sdk-incubator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Nacos SDK
0.2.1
2021-06-19 12:51 UTC
Requires
- php: >=7.3
- guzzlehttp/guzzle: ^6.5|^7.0
- hyperf/contract: ^2.1
- hyperf/utils: ^2.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/config: ^2.1
- hyperf/di: ^2.1
- hyperf/event: ^2.1
- hyperf/framework: ^2.1
- hyperf/guzzle: ^2.1
- hyperf/load-balancer: ^2.1
- hyperf/logger: ^2.1
- hyperf/process: ^2.1
- mockery/mockery: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: >=7.0
- swoole/ide-helper: dev-master
- symfony/var-dumper: ^5.1
Suggests
- ext-json: *
- ext-simplexml: *
- ext-yaml: *
- hyperf/event: ~2.1.0
- hyperf/framework: ~2.1.0
- hyperf/logger: ~2.1.0
- hyperf/process: ~2.1.0
This package is auto-updated.
Last update: 2021-07-19 13:01:05 UTC
README
安装
composer require hyperf/nacos-sdk-incubator
使用
<?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());