phptars/tars-utils
最新稳定版本:0.3.2
Composer 安装命令:
composer require phptars/tars-utils
包简介
tars的php辅助文件
README 文档
README
tars-utils is an auxiliary class library of phptars, which mainly provides the following functions:
-
Profile resolution and caching (swoole table)
-
Master address resolution
-
Node reporting configuration analysis
@parseFile($configPath)
For configuration file parsing, take qdphp.Tarsserver.Config.Conf as an example to parse conf file into array form
@getLocatorInfo($locatorString)
Address resolution, example:
$locatorString = "tars.tarsregistry.QueryObj@tcp -h 127.0.0.1 -p 17890:tcp -h 127.0.0.1 -p 17890"; $locatorInfo = \Tars\Utils::getLocatorInfo($locatorString);
result as below:
[ 'locatorName' => 'tars.tarsregistry.QueryObj', 'routeInfo' => [ [ 'sHost' => '127.0.0.1', 'sProtocol' => 'tcp', 'iPort' => 17890, 'iTimeout' => '', 'bIp' => '', 'sIp' => '' ], [ 'sHost' => '127.0.0.1', 'sProtocol' => 'tcp', 'iPort' => 17890, 'iTimeout' => '', 'bIp' => '', 'sIp' => '' ] ] ]
@parseNodeInfo($nodeInfo)
Node reporting configuration resolution, for example:
$locatorString = "tars.tarsnode.ServerObj@tcp -h 127.0.0.1 -p 2345 -t 10000"; $nodeInfo = \Tars\Utils::parseNodeInfo($locatorString);
The results are as follows:
[ 'objName' => 'tars.tarsnode.ServerObj', 'mode' => 'tcp', 'host' => '127.0.0.1', 'port' => 2345, 'timeout' => 1, 'sIp' => '', 'iPort' => 2345 ]
Changelog
v0.3.0(2019-06-21)
- support Multiple servant
统计信息
- 总下载量: 11.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-09-11