swoft-cloud /swoft

🚀 PHP Microservice Full Coroutine Framework

★ 5,531⑂ 760👁 220⑃ 282● 1,217▤ 26
PHPApache-2.0Created 2017-04-23swoft.org
下载:v2.0.11v2.0.11 ↓2.0.112021-05-08
+0
日增长
5,531
stars
760
forks
220
watchers
282
prs
1,217
issues
26
releases

README

!start-http-server

PHP 高性能微服务协程框架

 EN README

 简介

Swoft 是一款基于 Swoole 扩展实现的 PHP 微服务协程框架。Swoft 能像 Go 一样,内置协程网络服务器及常用的协程客户端且常驻内存,不依赖传统的 PHP-FPM。有类似 Go 语言的协程操作方式,有类似 Spring Cloud 框架灵活的注解、强大的全局依赖注入容器、完善的服务治理、灵活强大的 AOP、标准的 PSR 规范实现等等。

Swoft 通过长达三年的积累和方向的探索,把 Swoft 打造成 PHP 界的 Spring Cloud, 它是 PHP 高性能框架和微服务治理的最佳选择。

 功能特色

- 内置高性能网络服务器(Http/Websocket/RPC/TCP)
- 灵活的组件功能
- 强大的注解功能
- 多样化的命令终端(控制台)
- 强大的面向切面编程(AOP)
- 容器管理,依赖注入(DI)
- 灵活的事件机制
- 基于PSR-7的HTTP消息的实现
- 基于PSR-14的事件管理
- 基于PSR-15的中间件
- 国际化(i18n)支持
- 简单有效的参数验证器
- 高性能连接池(Mysql/Redis/RPC),自动重新连接
- 数据库高度兼容Laravel的使用方式
- Redis高度兼容Laravel的使用方式
- 秒级定时任务
- 进程池
- 高效的任务处理
- 灵活的异常处理
- 强大的日志系统
- 服务注册与发现
- 配置中心
- 服务限流
- 服务降级
- 服务熔断
- Apollo
- Consul

 在线文档

- 中文文档
- English

 学习交流

- QQ Group3: 541038173
- QQ Group2: 778656850(已满)
- QQ Group1: 548173319(已满)
- swoft-cloud/community

 免费技术支持

!support

 Requirement

- PHP 7.1+
- Swoole 4.3.4+
- Composer

 Install

 Composer

bash
composer create-project swoft/swoft swoft


 Start

- Http server

bash
[root@swoft swoft] php bin/swoft http:start


- WebSocket server

bash
[root@swoft swoft] php bin/swoft ws:start


- RPC server

bash
[root@swoft swoft] php bin/swoft rpc:start


 核心组件

Component Name   | Packagist Version
--------------------|---------------------
swoft-annotation          |   
swoft-config              |   
swoft-db                  |   
swoft-framework           |   
swoft-i18n                |   
swoft-proxy               |   
swoft-rpc-client          |   
swoft-stdlib              |   
swoft-tcp-server          |   
swoft-aop                 |   
swoft-connection-pool     |   
swoft-error               |   
swoft-http-message        |   
swoft-log                 |   
swoft-redis               |   
swoft-rpc-server          |   
swoft-task                |   
swoft-validator           |   
swoft-bean                |   
swoft-console             |   
swoft-event               |   
swoft-http-server         |   
swoft-process             |   
swoft-rpc                 |   
swoft-server              |   
swoft-tcp                 |   
swoft-websocket-server    |   

 扩展组件

Component Name   | Packagist Version
-----------------|---------------------
swoft-apollo  | 
swoft-breaker | 
swoft-cache  | 
swoft-crontab | 
swoft-consul  | 
swoft-limiter | 
swoft-view    | 
swoft-whoops  | 
swoft-session  | 

 License

Swoft is an open-source software licensed under the LICENSE

Top issues

Discussions

Latest release

v2.0.11 v2.0.11 2021-05-08
Change Log

 Fixed

 - fix type error on throw db exception https://github.com/swoft-cloud/swoft-component/commit/ee5814523fa505a576029f5e58edd88889b9e708
 - fix: Redis::scan 方法 迭代值不返回问题修复 https://github.com/swoft-cloud/swoft-component/commit/e6b3304e2e412b9efd2b9bdc7a49d454dd90cf83
 - fix. PDOException的code可能为字符串 https://github.com/swoft-cloud/swoft-component/commit/2e82980a4a770014fd99e6c13e67807c542da091
 - fix: Class 'Swoole\Coroutine' not found https://github.com/swoft-cloud/swoft-component/commit/2340d5a10fd92354a1944a09a8f61a725ae228aa
 - fix. Redis释放连接时的内存泄漏 https://github.com/

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON