1 Star 0 Fork 0

TarsPHP/tars-config

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
6 years ago
Loading...
README

Instruction of using tar config

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

Instructions for use

<?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);

Empty file

About

php拉取配置的组件 expand collapse
Cancel

Releases

No release

Contributors (4)

All

Activities

5年多前创建了仓库
can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/TarsPHP/tars-config.git
git@gitee.com:TarsPHP/tars-config.git
TarsPHP
tars-config
tars-config
master

Search