PHPackages                             sean-ren/thrift - 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. sean-ren/thrift

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

sean-ren/thrift
===============

让Thrift使用起来更简洁

0.9.4.x-dev(10y ago)0901MITPHPPHP &gt;=5.3.0

Since Dec 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/longfeiRen/php-thrift)[ Packagist](https://packagist.org/packages/sean-ren/thrift)[ RSS](/packages/sean-ren-thrift/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

### Thrift Client Api for PHP

[](#thrift-client-api-for-php)

整合Thrift官方提供的包,融合workerman客户端连接并对其进行优化。

包加载说明
-----

[](#包加载说明)

修改composer.json

```
"require": {
	"sean-ren/thrift"	: "0.9.*"
}

```

根据Thrift idl生成客户端代码，生成命令示例：

```
thrift --gen php message.thrift

```

然后加载客户端代码，可以通过composer加载；修改composer.json：

```
"autoload" : {
		"classmap" : ["客户端代码目录"]
}

```

如果对composer自动加在不熟悉可以参考[composer手册](http://docs.phpcomposer.com/)

使用示例
----

[](#使用示例)

```
use Thrift\Clients\ThriftClient,
	 example\Message;
ThriftClient::config(array(
                        'MessageService' => array(
                            'addresses' => array(
                               '127.0.0.1:9001'
                            ),
                            'thrift_protocol' => 'TCompactProtocol',//不配置默认是TBinaryProtocol，对应服务端Message.conf配置中的thrift_protocol
                            'thrift_transport' => 'TFramedTransport',//不配置默认是TBufferedTransport，对应服务端Message.conf配置中的thrift_transport
                            "namespace_name" => "\\example\\MessageServiceClient",
                            "service_dir" => "yourpath/example" //如果不想使用命名空间可以填写路径自动加载
                        ),
                    )
                );
$client = ThriftClient::instance("MessageService");

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

3860d ago

### Community

Maintainers

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

---

Top Contributors

[![longfeiRen](https://avatars.githubusercontent.com/u/7404255?v=4)](https://github.com/longfeiRen "longfeiRen (2 commits)")

---

Tags

php Thrift

### Embed Badge

![Health badge](/badges/sean-ren-thrift/health.svg)

```
[![Health](https://phpackages.com/badges/sean-ren-thrift/health.svg)](https://phpackages.com/packages/sean-ren-thrift)
```

PHPackages © 2026

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