PHPackages                             phptars/tars-client - 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. phptars/tars-client

ActiveLibrary

phptars/tars-client
===================

tars的php-client能力

0.3.0(6y ago)711.6k↓100%7[2 issues](https://github.com/TarsPHP/tars-client/issues)[1 PRs](https://github.com/TarsPHP/tars-client/pulls)3PHPPHP &gt;=5.3

Since Sep 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/TarsPHP/tars-client)[ Packagist](https://packagist.org/packages/phptars/tars-client)[ RSS](/packages/phptars-tars-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (3)

tars-client
===========

[](#tars-client)

Brief introduction

It mainly includes the receiving and sending capacity and reporting capacity of the master addressing network

The tests directory provides a test case for the tar service. Service name is \* \* app.server.servant\*\*

Instructions for use
--------------------

[](#instructions-for-use)

Refer to the test cases provided.

The tar client side calls the tar service. When instantiating, it needs to pass in an instance of \* \* \\ tars \\ client \\ communicator config \* \* and set the necessary configuration information. It mainly includes the following contents

- Service address
- Master addressing
- When there are multiple machines providing services, services can be found through the master automatic addressing mode
- Specify service address
- Use this method when grayscale or service needs to be obtained from a specific address
- Network transmission
- There are three modes: socket, swoole sync and swoole coroutine
- sign up
- Specifies the escalation module name. By default, the master address is \* \* tarsprox \* \*, which can be filled in according to the business when specifying the service address
- Encoding format

### Service addressing mode

[](#service-addressing-mode)

Combined with the test case testservant.php, the code specifications of different service addressing are introduced.

Set the relevant configuration through \* \* \\ tars \\ client \\ communicatorconfig \* \* class. The test case gives the example codes of two addressing modes

1. Master addressing

Once the locator is specified, the tar can automatically grab the service address according to the service name. The format of the locator configuration is as follows

```
$config = new \Tars\client\CommunicatorConfig();

$config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890");
```

The tar master is also a tar service. The service name is \* \* tar. Tarsregistry. Queryobj \* *, the transmission protocol is TCP, the service address is 172.16.0.161, and the port is 17890. Please fill in \* \* according to the actual situation of the service during the actual development*\*

After the above master service is determined, the module name and coding format can be specified as required. The default escalation module name is \* \* tarsproxy \* \*. In order to facilitate business tracking, it is recommended to re specify the escalation module name

```

$config->setModuleName("App.Server");

$config->setCharsetName("UTF-8");

```

2. Specify IP

Specify the address of the service party. In this way, you need to specify the IP and port of the service. The code is as follows.

```
$route['sIp'] = "127.0.0.1";

$route['iPort'] = 8080;

$routeInfo[] = $route;

$config = new \Tars\client\CommunicatorConfig();

$config->setRouteInfo($routeInfo);
```

Other uses are the same as automatic addressing

Changelog

### v0.3.0(2019-07-30)

[](#v0302019-07-30)

-Services that support calling protobuf

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Every ~55 days

Total

7

Last Release

2467d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf1b3ee26ddb9ebe4490a8f1bcd84a7450fa70cf0bf367fd6c267ba7d353d3fd?d=identicon)[phptars](/maintainers/phptars)

---

Top Contributors

[![meijing0114](https://avatars.githubusercontent.com/u/2072584?v=4)](https://github.com/meijing0114 "meijing0114 (8 commits)")[![bobzhangyong](https://avatars.githubusercontent.com/u/4799677?v=4)](https://github.com/bobzhangyong "bobzhangyong (3 commits)")[![danielzheng-Tencent](https://avatars.githubusercontent.com/u/60135050?v=4)](https://github.com/danielzheng-Tencent "danielzheng-Tencent (1 commits)")

### Embed Badge

![Health badge](/badges/phptars-tars-client/health.svg)

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

###  Alternatives

[phptars/tars-server

tars的php框架

1110.9k4](/packages/phptars-tars-server)

PHPackages © 2026

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