verystar / nacos-php-sdk
The alibaba nacos SDK for php
v1.0.1
2021-06-07 09:31 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ~5.7
This package is auto-updated.
Last update: 2025-01-07 17:29:33 UTC
README
Aliyun Nacos SDK for PHP
Install
composer require verystar/nacos-php-sdk
Or add a dependency to the composer.json
"require": {
"verystar/nacos-php-sdk": "1.0.*"
}
Run
composer update
Usage
use Very\Nacos\Client; $client = new Client([ "username"=>"***********", "password"=>"***********", "server_addr"=>"https://test.nacos.com", "namespace"=>"***********", ]); //get config $ret = $client->getConfig("test","DEFAULT_GROUP"); print_r($ret); //save config if config file not exists $client->saveConfig("test","DEFAULT_GROUP","./config/db.php");
Exception
if throw NacosException,the fetch configuration failed
License
The SDK is open-sourced software licensed under the MIT license.