Fetch the repository succeeded.
Brief introduction
Tar config is used to obtain the configuration distributed from the tar management platform. Usually use the business configuration corresponding to the distribution environment, such as mysql, redis address, port and other information
<?php
require_once "../vendor/autoload.php";
$config = new \Tars\client\CommunicatorConfig();
$config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); //The configuration here is the tar master address
$config->setModuleName("tedtest"); //The primary call name is used to display the secondary primary call report.
$config->setCharsetName("UTF-8"); //character set
$conigServant = new \Tars\config\ConfigServant($config);
$result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext); //The parameters are appName (service name part I), server name (service name part II), file name, and the last is reference parameter, which is the content of the output configuration file.
var_dump($configtext);
$config->setSocketMode(2); // setup socket model为2 swoole tcp client,1为socket,3为swoole protocol client
$conigServant = new \Tars\config\ConfigServant($config);
$result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext);
var_dump($configtext);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。