PHPackages                             fastd/fastd - 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. [Caching](/categories/caching)
4. /
5. fastd/fastd

ActiveLibrary[Caching](/categories/caching)

fastd/fastd
===========

A High Performance API Framework By Swoole Extension

v8.0.0(1mo ago)42015.5k80[16 issues](https://github.com/fastdlabs/fastD/issues)[2 PRs](https://github.com/fastdlabs/fastD/pulls)17MITPHPPHP &gt;=8.2CI failing

Since Jul 17Pushed 1mo ago26 watchersCompare

[ Source](https://github.com/fastdlabs/fastD)[ Packagist](https://packagist.org/packages/fastd/fastd)[ Docs](https://fastdlabs.com/)[ RSS](/packages/fastd-fastd/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (29)Versions (79)Used By (17)

 [![](https://avatars0.githubusercontent.com/u/20292713?s=200&v=4)](https://avatars0.githubusercontent.com/u/20292713?s=200&v=4)

FastD
=====

[](#fastd)

🚀 A high performance PHP API framework based on PSR standards and Swoole extension.

[![](https://camo.githubusercontent.com/c895f8f229f0012f31909dbd8546200878184d870c91f9e0480f62bcc37c970f/68747470733a2f2f7472617669732d63692e6f72672f66617374646c6162732f66617374442e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fastdlabs/fastD)[![](https://camo.githubusercontent.com/3807086bbc4cfb6c4651c6097c444fb84f08e57ebf0383a5ac62e108a5e80e96/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66617374646c6162732f66617374442f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 "Scrutinizer Code Quality")](https://scrutinizer-ci.com/g/fastdlabs/fastD/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6d09bf55337657cb79ba6b9e414c4b17108086fd1cfe76b10f401ff96d51692e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66617374646c6162732f66617374442f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fastdlabs/fastD/?branch=master)[![](https://camo.githubusercontent.com/57a4b2b97b530830a27833fee0e4f091c19a05a2936c2e4a1b319d1349ad1f35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d627269676874677265656e)](http://www.php.net/)[![](https://camo.githubusercontent.com/f878003868384f1d2423d1c430f15cb8810eca6d20087a500bf2c39db534c3c9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73776f6f6c652d253345253344342e352d627269676874677265656e)](http://www.swoole.com/)[![](https://camo.githubusercontent.com/4ec67cce7cac7a152fd08bc489e0795b86a2f4307b2020fa88c8e36b4b03b9c3/68747470733a2f2f706f7365722e707567782e6f72672f66617374642f66617374642f6c6963656e7365)](https://fastdlabs.com/)

FastD 是一个轻量级的高性能 PHP Web 开发框架，基于 PSR 标准和 Swoole 扩展构建。适用于对性能有严格要求的 API 服务场景，提供灵活的扩展机制让开发者轻松构建自己的服务。

✨ 特性
----

[](#-特性)

- 🎯 **PSR 标准兼容**: 完全遵循 PSR-11 容器接口规范
- ⚡ **高性能**: 基于 Swoole 协程引擎，支持异步非阻塞 I/O
- 📦 **轻量级**: 核心组件精简，按需加载扩展
- 🔧 **灵活扩展**: 基于 ServiceProvider 的插件化架构
- 🎭 **多运行环境**: 支持 Swoole Server、FastCGI、Console、Process 等多种运行模式
- 📝 **完善测试**: 全面的单元测试覆盖，保证代码质量

📋 要求
----

[](#-要求)

- PHP &gt;= 8.2
- Swoole &gt;= 4.5 (可选，用于高性能模式)
- Composer

🚀 快速开始
------

[](#-快速开始)

### 安装

[](#安装)

```
composer create-project fastd/fastd my-app
cd my-app
```

### 启动服务

[](#启动服务)

```
# Swoole 模式（推荐）
php server start

# FastCGI 模式（传统 PHP-FPM）
# 配置 Nginx 指向 web 目录

# 命令行模式
php console list

# 多进程模式
php process start
```

### 创建路由

[](#创建路由)

```
// config/routes.php
return [
    ['GET', '/hello', function($request) {
        return json(['message' => 'Hello, FastD!']);
    }],
];
```

### 访问服务

[](#访问服务)

```
curl http://localhost:9999/hello
# {"message":"Hello, FastD!"}
```

📚 架构设计
------

[](#-架构设计)

### 核心组件

[](#核心组件)

- **Application**: 应用核心类，继承自 PSR-11 容器
- **Runtime**: 运行时抽象，支持多种运行环境
- **Container**: 依赖注入容器，支持延迟实例化和单例模式
- **Event**: 事件驱动架构，基于 PSR-14 事件调度器
- **Routing**: 高性能路由系统
- **HTTP**: PSR-7 HTTP 消息实现
- **Middleware**: PSR-15 中间件支持

### 运行模式

[](#运行模式)

1. **Swoole Server**: 常驻内存，极致性能
2. **FastCGI**: 兼容传统 PHP-FPM 部署
3. **Console**: 命令行工具支持
4. **Process**: 多进程任务处理

📖 文档
----

[](#-文档)

我们希望不仅仅是提供一个开发框架，更希望能够将自己的经验整理成解决方案，开发套件分享和贡献给社区。

- [中文文档](http://docs.fastdlabs.com/#/zh-cn/3.2/readme)
- [English Document](https://docs.fastdlabs.com/#/en-us/3.2/readme)

🧪 测试
----

[](#-测试)

```
# 运行单元测试
php vendor/bin/phpunit

# 查看测试覆盖率
php vendor/bin/phpunit --coverage-html coverage
```

🤝 贡献
----

[](#-贡献)

感谢所有为 FastD 做出贡献的开发者：

- [yyz26371945](https://github.com/yyz26371945)
- [RunnerLee](https://github.com/RunnerLee)
- [zqhong](https://github.com/zqhong)
- [xsharp](https://github.com/xsharp)

欢迎提交 Issue 和 Pull Request！

🙏 鸣谢
----

[](#-鸣谢)

[![](https://camo.githubusercontent.com/5f2b776d06bbf3b22235f95418e233587765fa4702d6e873c33a1a422bc79815/68747470733a2f2f733130332e676777616e2e636f6d2f6d61696e6c696e6768697476322f696d616765732f7075626c69632f6c6f676f2e706e67)](https://camo.githubusercontent.com/5f2b776d06bbf3b22235f95418e233587765fa4702d6e873c33a1a422bc79815/68747470733a2f2f733130332e676777616e2e636f6d2f6d61696e6c696e6768697476322f696d616765732f7075626c69632f6c6f676f2e706e67)

非常欢迎感兴趣，愿意参与其中，共同打造更好 PHP 生态、Swoole 生态的开发者。

如果你乐于此，却又不知如何开始，可以试试下面这些事情：

- 在你的系统中使用，将遇到的问题 [反馈](https://github.com/JanHuang/fastD/issues)
- 有更好的建议？欢迎联系  或 [新浪微博:编码侠](http://weibo.com/ecbboyjan)
- 帮助改进文档或翻译
- 分享你的使用经验和最佳实践

📮 联系
----

[](#-联系)

如果你在使用中遇到问题，请联系：

- Email:
- Weibo: [编码侠](http://weibo.com/ecbboyjan)
- GitHub: [Issues](https://github.com/JanHuang/fastD/issues)

📄 License
---------

[](#-license)

MIT License

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance92

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.3% 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 ~53 days

Recently: every ~464 days

Total

76

Last Release

37d ago

Major Versions

v0.1.0 → v1.0.02015-07-24

v1.1.0 → v2.0.0-beta12016-05-12

2.1.x-dev → v3.0.0-rc12017-01-17

v3.2.7 → 5.0.x-dev2019-05-08

3.2.x-dev → v8.0.02026-05-28

PHP version history (6 changes)v0.1.0-BETA1PHP &gt;=5.4.0

v2.0.0-beta1PHP &gt;=7

v2.0.0PHP &gt;=7.0

v3.0.0-rc1PHP &gt;=5.6

5.0.x-devPHP &gt;=7.1

v8.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/94c2bc821caf23977e1c3deea85e3cbc9a73a632e1afaf778638f7fe9da1c42b?d=identicon)[JanHuang](/maintainers/JanHuang)

---

Top Contributors

[![JanHuang](https://avatars.githubusercontent.com/u/7090871?v=4)](https://github.com/JanHuang "JanHuang (1164 commits)")[![RunnerLee](https://avatars.githubusercontent.com/u/7436388?v=4)](https://github.com/RunnerLee "RunnerLee (28 commits)")[![xsharp](https://avatars.githubusercontent.com/u/36738?v=4)](https://github.com/xsharp "xsharp (4 commits)")[![longxinH](https://avatars.githubusercontent.com/u/12230340?v=4)](https://github.com/longxinH "longxinH (3 commits)")[![xueron](https://avatars.githubusercontent.com/u/2560873?v=4)](https://github.com/xueron "xueron (3 commits)")[![zqhong](https://avatars.githubusercontent.com/u/8402647?v=4)](https://github.com/zqhong "zqhong (2 commits)")[![yyz26371945](https://avatars.githubusercontent.com/u/20291334?v=4)](https://github.com/yyz26371945 "yyz26371945 (2 commits)")[![viliy](https://avatars.githubusercontent.com/u/22161786?v=4)](https://github.com/viliy "viliy (1 commits)")[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (1 commits)")[![wangsir0624](https://avatars.githubusercontent.com/u/19991740?v=4)](https://github.com/wangsir0624 "wangsir0624 (1 commits)")

---

Tags

apifastdhigh-performancephpprocessserversocketswoolehttp-messageapicontainercacheFastDhttp-server-handlerhttp-server-middle

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M572](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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