PHPackages                             warnstar/tin-core - 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. warnstar/tin-core

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

warnstar/tin-core
=================

swoole http server

0.1(7y ago)018MITPHPPHP &gt;=7.0.0

Since Oct 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/warnstar/tin-core)[ Packagist](https://packagist.org/packages/warnstar/tin-core)[ RSS](/packages/warnstar-tin-core/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

tin
===

[](#tin)

### 部署

[](#部署)

#### 安装

[](#安装)

```
git clone https://github.com/warnstar/tin.git
cd tin
composer install

```

#### 启动

[](#启动)

```
require_once __DIR__ .  './vendor/autoload.php';

$r = new \Tin\Router();

$r->get('/', \app\admin\controllers\IndexController::class . '@index');

$components['router'] =  $r;
$components['server'] = \Tin\HttpServer::build();

(new \Tin($components))->run();

```

### 路由配置

[](#路由配置)

> 任意文件内配置路由对象，然后注入到application中启动

```
// 实例化路由处理器对象
$r = new \Tin\Base\Router();

// 设置全局中间件
$r->addMiddleware(\app\middleware\TestMiddleware::class);

// 路由内设置中间件
$r->get('/mid2', \app\controllers\IndexController::class . '@index')->addMiddleware(\app\middleware\AbcMiddleware::class);

// 设置路由
$r->get('/users', \app\controllers\IndexController::class . '@index');
$r->get('/index/{id:\d+}', \app\controllers\IndexController::class . '@index');

// 设置路由组
$r->group("/test", function(\Tin\Base\Router $r){
    $r->get('/mid', \app\controllers\TestController::class . '@mid');
});
```

请求处理
----

[](#请求处理)

### 获取请求参数

[](#获取请求参数)

> 在action控制器运行

#### 获取请求头

[](#获取请求头)

```
$this->request->getHeaders();
$this->request->getHeader("key");
```

#### 获取请求参数

[](#获取请求参数-1)

```
// query
$this->request->getQueryParams();
$this->request->getQueryParam("key");

// form or json
$this->request->getParsedBodyParam("key" , "default");
$this->request->getParsedBody();
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

2754d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6067095?v=4)[Frank Huang](/maintainers/wchuang)[@wchuang](https://github.com/wchuang)

---

Top Contributors

[![warnstar](https://avatars.githubusercontent.com/u/10740548?v=4)](https://github.com/warnstar "warnstar (53 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/warnstar-tin-core/health.svg)

```
[![Health](https://phpackages.com/badges/warnstar-tin-core/health.svg)](https://phpackages.com/packages/warnstar-tin-core)
```

###  Alternatives

[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[mezzio/mezzio-fastroute

FastRoute integration for Mezzio

162.7M52](/packages/mezzio-mezzio-fastroute)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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