verystar/nacos-php-sdk

The alibaba nacos SDK for php

v1.0.1 2021-06-07 09:31 UTC

This package is auto-updated.

Last update: 2024-04-07 15:58:57 UTC


README

Total Downloads Latest Stable Version

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.