PHPackages                             caasdata/tars-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. caasdata/tars-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

caasdata/tars-utils
===================

tars的php辅助文件

0.1.3(7y ago)03243PHPPHP &gt;=5.3

Since Dec 25Pushed 7y agoCompare

[ Source](https://github.com/caasdata/tars-utils)[ Packagist](https://packagist.org/packages/caasdata/tars-utils)[ RSS](/packages/caasdata-tars-utils/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (3)

tars-utils
==========

[](#tars-utils)

---

`tars-utils` 是 phptars的辅助类库，主要提供如下几个功能：

- 配置文件解析并缓存(swoole table)
- 主控地址解析
- node上报配置解析

### @parseFile($configPath)

[](#parsefileconfigpath)

配置文件解析，以`QDPHP.TARSServer.config.conf` 为例，将`conf` 文件解析成 数组形式

### @getLocatorInfo($locatorString)

[](#getlocatorinfolocatorstring)

地址解析，示例：

```
$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);
```

得到结果如下：

```
[
	'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)

[](#parsenodeinfonodeinfo)

node上报配置解析，示例：

```
$locatorString = "tars.tarsnode.ServerObj@tcp -h 127.0.0.1 -p 2345 -t 10000";

$nodeInfo = \Tars\Utils::parseNodeInfo($locatorString);
```

得到结果如下：

```
[
	'objName' => 'tars.tarsnode.ServerObj',
	'mode' => 'tcp',
	'host' => '127.0.0.1',
	'port' => 2345,
	'timeout' => 1,
	'sIp' => '',
	'iPort' => 2345
]
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2698d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46128427?v=4)[caasdata](/maintainers/caasdata)[@caasdata](https://github.com/caasdata)

---

Top Contributors

[![caasdata](https://avatars.githubusercontent.com/u/46128427?v=4)](https://github.com/caasdata "caasdata (1 commits)")

### Embed Badge

![Health badge](/badges/caasdata-tars-utils/health.svg)

```
[![Health](https://phpackages.com/badges/caasdata-tars-utils/health.svg)](https://phpackages.com/packages/caasdata-tars-utils)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
