PHPackages                             wenbinye/tars-gen - 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. wenbinye/tars-gen

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

wenbinye/tars-gen
=================

TARS PHP code generator

0.4.2(4y ago)012.9k↓50%[1 PRs](https://github.com/wenbinye/tars-generator/pulls)3MITPHPPHP &gt;=7.2.5

Since Jul 15Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (12)Used By (3)

TARS 代码生成器
==========

[](#tars-代码生成器)

Installation
------------

[](#installation)

```
composer require --dev wenbinye/tars-gen:^0.3
```

Usage
-----

[](#usage)

```
$ ./vendor/bin/tars-gen
```

Integration to composer
-----------------------

[](#integration-to-composer)

Add Configuration in composer.json:

```
{
  "scripts": {
     "gen": "./vendor/bin/tars-gen"
  }
}
```

生成器配置文件为 tars/config.json 文件。配置文件示例：

```
{
    "client": {
        "servants": {
            "Hello": "TestApp.HelloServer.HelloObj"
        }
    }
}
```

配置中 servant, client 分别对应生成服务提供方接口代码和客户端代码。

配置项包括：

- `namespace` 代码生成的名字空间，默认会读取项目 `composer.json` 文件中第一个 psr-4 规则，client 添加 'integration'，servant 添加 'servant'
- `output`代码生成目录，默认会使用 composer.json 第一个 psr-4 规则根据 psr-4 规则计算输出目录
- `flat` 是否将文件中的 module 加入到命名空间中，默认对于 client 为 false，对于 servant 为 true
- `tars_path` tars 文件目录，默认为 client 为 tars/client, servant 为 tars/servant
- `servants` tars 服务名列表，通过 `{moduleName}.{interfaceName}` 或 `{interfaceName}` 查询

> tars 文件目录结构通常包含 servant 和 client 两个目录。如果确定本项目不会提供 tars rpc 服务，可以将所有 client 的定义文件都放到 tars 目录下，然后设置 client.tars\_path 为 "tars"。

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity46

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

Every ~171 days

Recently: every ~192 days

Total

7

Last Release

1097d ago

PHP version history (5 changes)0.1.1PHP ^7.0

0.3.6PHP ^7.2

0.4.1PHP &gt;=7.2.5

v0.5.x-devPHP &gt;=7.4

v0.6.x-devPHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/28c8284abda0bddba804c7919864a36b925898741745ff910f98cd7f2fd73625?d=identicon)[wenbinye](/maintainers/wenbinye)

---

Top Contributors

[![wenbinye](https://avatars.githubusercontent.com/u/1221975?v=4)](https://github.com/wenbinye "wenbinye (34 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wenbinye-tars-gen/health.svg)

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

###  Alternatives

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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