PHPackages                             tonydeng/tcp4p - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. tonydeng/tcp4p

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tonydeng/tcp4p
==============

Thrift Client Pool For PHP

1.0.1(10y ago)1101MITPHPPHP &gt;=5.3.2

Since Mar 24Pushed 10y ago1 watchersCompare

[ Source](https://github.com/tonydeng/tcp4p)[ Packagist](https://packagist.org/packages/tonydeng/tcp4p)[ RSS](/packages/tonydeng-tcp4p/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (4)Used By (0)

### TCP4P (Thrift Client Pool For PHP)

[](#tcp4p-thrift-client-pool-for-php)

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

包加载说明
-----

[](#包加载说明)

修改composer.json

```
"require": {
	"tonydeng/tcp4p"	: "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

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

2

Last Release

3749d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

1.0.1PHP &gt;=5.3.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/629519?v=4)[Tony Deng](/maintainers/tonydeng)[@tonydeng](https://github.com/tonydeng)

---

Top Contributors

[![tonydeng](https://avatars.githubusercontent.com/u/629519?v=4)](https://github.com/tonydeng "tonydeng (11 commits)")

---

Tags

composerphptcp4pthriftthrift-client-poolphpthrifttcp4p

### Embed Badge

![Health badge](/badges/tonydeng-tcp4p/health.svg)

```
[![Health](https://phpackages.com/badges/tonydeng-tcp4p/health.svg)](https://phpackages.com/packages/tonydeng-tcp4p)
```

###  Alternatives

[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76423.5k2](/packages/hannesvdvreken-guzzle-debugbar)

PHPackages © 2026

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