1. Go to this page and download the library: Download tinywan/nacos-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tinywan / nacos-sdk-php example snippets
use Nacos\NacosClient;
$client = new NacosClient('localhost', 8848);
$dataId = 'database.php';
$group = 'DEFAULT_GROUP';
$result = $client->getConfig($dataId, $group);
use Nacos\NacosClient;
use Nacos\NacosAuth;
$client = new NacosClient('localhost', 8848);
$auth = new NacosAuth($client);
$auth->login('nacos','nacos');
$dataId = 'database.php';
$group = 'DEFAULT_GROUP';
$result = $client->getConfig($dataId, $group);