PHPackages                             tsaotai/tsaotai-helper - 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. tsaotai/tsaotai-helper

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

tsaotai/tsaotai-helper
======================

TsaoTai Helper Functions - 提供 pull HTTP请求 和 push 统一响应等工具函数

2026.1.1(1mo ago)01↓90%Apache-2.0PHPPHP &gt;=8.0.0

Since Jun 3Pushed 1mo agoCompare

[ Source](https://github.com/tsaotai/tsaotai-helper)[ Packagist](https://packagist.org/packages/tsaotai/tsaotai-helper)[ Docs](https://github.com/tsaotai/tsaotai-helper)[ RSS](/packages/tsaotai-tsaotai-helper/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

TsaoTai Helper
==============

[](#tsaotai-helper)

通用辅助函数包。

[![Version](https://camo.githubusercontent.com/c9cd003c0c3db3a9266cd5e009b0c4ae058184d340189f0e007ac2822d3ae9ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d323032362e312e312d626c75652e737667)](CHANGELOG.md)[![License](https://camo.githubusercontent.com/a8cb6955fb6e825727774da32760c729c43dcde6b3f19232539089af14348deb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368652d2d322e302d677265656e2e737667)](LICENSE)

---

安装
--

[](#安装)

```
composer require tsaotai/tsaotai-helper
```

---

函数列表
----

[](#函数列表)

函数说明`pull()`HTTP 请求工具`push()`统一响应工具`uuid()`生成 UUID v4---

使用示例
----

[](#使用示例)

### pull - HTTP 请求

[](#pull---http-请求)

```
// GET 请求
$result = pull('https://api.example.com/users', 'GET', ['page' => 1]);

// POST 请求
$result = pull('https://api.example.com/users', 'POST', [
    'name' => '张三',
    'email' => 'zhang@example.com'
]);

// 返回格式
// ['code' => 200, 'data' => [...], 'http_code' => 200]
```

### push - 统一响应

[](#push---统一响应)

```
// 成功响应
return push(0, '操作成功', $data);

// 失败响应
return push(404, '资源不存在');

// 返回格式
// {
//     "success": true,
//     "code": 0,
//     "message": "操作成功",
//     "data": [...],
//     "timestamp": 1685700000,
//     "request_id": "uuid-xxx",
//     "version": "1.0.0"
// }
```

### uuid - 生成 UUID

[](#uuid---生成-uuid)

```
$id = uuid();
// "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
```

---

更新日志
----

[](#更新日志)

查看 [CHANGELOG.md](CHANGELOG.md)

---

许可证
---

[](#许可证)

Apache-2.0 License

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c0f87313bc5412f0d3eebb3c05a798d5a71d7569c50d34d9b6d1e7d9e196b86?d=identicon)[tsaotai](/maintainers/tsaotai)

---

Tags

httpresponsehelperfunctionsthinkphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsaotai-tsaotai-helper/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.1k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.0k1.1B7.3k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k747.1M2.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39397.5M317](/packages/fig-http-message-util)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

49119.8M612](/packages/nette-http)[psr/http-server-handler

Common interface for HTTP server-side request handler

180114.7M1.3k](/packages/psr-http-server-handler)

PHPackages © 2026

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