Swoole
PHP的异步、并行、高性能网络通信引擎,使用纯C语言编写,提供了[PHP语言的异步多线程服务器](/wiki/page/p-server.html),[异步TCP/UDP网络客户端](/wiki/page/p-client.html),[异步MySQL](/wiki/page/517.html),[异步Redis](/wiki/page/p-redis.html),[数据库连接池](https://github.com/swoole/framework/blob/master/tests/async_mysql.php),[AsyncTask](/wiki/page/134.html),[消息队列](http://wiki.swoole.com/wiki/page/289.html),[毫秒定时器](/wiki/page/244.html),[异步文件读写](/wiki/page/183.html),[异步DNS查询](/wiki/page/186.html)。 Swoole内置了[Http/WebSocket服务器端](/wiki/page/326.html)/[客户端](/wiki/page/p-http_client.html)、[Http2.0服务器端](/wiki/page/326.html)/[客户端](/wiki/page/708.html)。
Swoole底层内置了异步非阻塞、多线程的网络IO服务器。PHP程序员仅需处理事件回调即可,无需关心底层。与`Nginx`/`Tornado`/`Node.js`等全异步的框架不同,Swoole既支持全异步,也支持同步。
除了异步IO的支持之外,Swoole为PHP多进程的模式设计了多个并发数据结构和IPC通信机制,可以大大简化多进程并发编程的工作。其中包括了[并发原子计数器](/wiki/page/p-atomic.html),[并发HashTable](/wiki/page/p-table.html),[Channel](/wiki/page/p-channel.html),[Lock](/wiki/page/p-lock.html),[进程间通信IPC](/wiki/page/363.html)等丰富的功能特性。
Swoole从2.0版本开始支持了**[内置协程](/wiki/page/p-coroutine.html)**,可以使用完全同步的代码实现异步程序。PHP代码无需额外增加任何关键词,底层自动进行协程调度,实现异步。
__Swoole__可以广泛应用于互联网、移动通信、企业软件、网络游戏、物联网、车联网、智能家庭等领域。 使用`PHP+Swoole`作为网络通信框架,可以使企业IT研发团队的效率大大提升,更加专注于开发创新产品。
Swoole是开源免费的自由软件,授权协议是`Apache2.0`。企业和个人开发者均可免费使用Swoole的代码,并且在Swoole之上所作的修改可用于商业产品,无需开源(注:必须保留原作者的版权声明)。
> `1.8.7`或更高版本已完全兼容`PHP7`
> `2.0.12`版本开始不再支持`PHP5`
* 国内Git镜像:[https://gitee.com/swoole/swoole](https://gitee.com/swoole/swoole)
* 新手入门教程:[https://www.gitbook.com/book/linkeddestiny/easy-swoole/details](https://www.gitbook.com/book/linkeddestiny/easy-swoole/details)
* IDE自动提示工具 php-reflection-code:[https://github.com/flyhope/php-reflection-code](https://github.com/flyhope/php-reflection-code)
* IDE自动提示工具 swoole-ide-helper:[https://github.com/eaglewu/swoole-ide-helper](https://github.com/eaglewu/swoole-ide-helper)
* 下载离线CHM文档: [https://github.com/smalleyes/swoole-chm](https://github.com/smalleyes/swoole-chm)
* HHVM-Swoole:[https://github.com/swoole/hhvm-swoole](https://github.com/swoole/hhvm-swoole)
* C++-Swoole:[https://github.com/swoole/cpp-swoole](https://github.com/swoole/cpp-swoole)
* Swoole Docset: [https://github.com/halfstring/swoole-chinese-docset](https://github.com/halfstring/swoole-chinese-docset)
社区资源
----
* [Swoole官方网站问答社区](http://group.swoole.com/) **(推荐使用)**
* [SegmentFault网站Swoole专区](https://segmentfault.com/t/swoole)
* [开发者头条Swoole频道](https://toutiao.io/s/swoole)
* [OSC社区Swoole问答板块](http://www.oschina.net/question/tag/swoole-server)
* [知乎-Swoole专区](https://www.zhihu.com/topic/20051981/hot)
微信公众号
-----

捐赠Swoole开源项目
----
您的捐赠是对Swoole项目开发组最大的鼓励和支持。我们会坚持开发维护下去。 您的捐赠将被用于:
* 持续和深入的开发
* 文档和社区的建设和维护
>>> [点击捐赠 Swoole 开源项目](https://gitee.com/swoole/swoole?donate=true)
#### 感谢 [51talk](http://www.51talk.com/) 捐赠 10000元 RMB
[](http://www.51talk.com/)
#### 感谢 [codecasts.com](https://codecasts.com/) 捐赠 8000元 RMB
[](https://codecasts.com/)
#### 感谢 [易软天创](http://www.cnezsoft.com/) 捐赠 3000元 RMB
> `Github`项目地址:[https://github.com/swoole/swoole-src/](https://github.com/swoole/swoole-src/) (支持请点Star)
`PHP`的 [协程](/wiki/page/p-coroutine.html) 高性能网络通信引擎,使用`C/C++`语言编写,提供了多种通信协议的网络服务器和客户端模块。包括:
* [TCP/UDP/UnixSock 服务器端](/wiki/page/p-server.html)
* [Http/WebSocket/Http2 服务器端](/wiki/page/326.html)
* [协程 TCP/UDP/UnixSock 客户端](/wiki/page/p-coroutine_client.html)
* [协程 MySQL 客户端](/wiki/page/p-coroutine_mysql.html)
* [协程 Redis 客户端](/wiki/page/p-coroutine_redis.html)
* [协程 Http/WebSocket 客户端](/wiki/page/p-coroutine_http_client.html)
* [协程 Http2 客户端](/wiki/page/p-coroutine_http2_client.html)
* [协程文件读写](/wiki/page/183.html)
* [AsyncTask](/wiki/page/134.html)
* [毫秒定时器](/wiki/page/244.html)
`Swoole4`支持完整的**[协程](/wiki/page/p-coroutine.html)编程模式**,可以使用完全同步的代码实现异步程序。`PHP`代码无需额外增加任何关键词,底层自动进行协程调度,实现异步`IO`。
> `Swoole4`协程仅支持`PHP7`,无法在`PHP5`中使用
除了[异步IO](/wiki/page/p-async.html)的支持之外,`Swoole`为`PHP`多进程的模式设计了多个并发数据结构和`IPC`通信机制,可以大大简化多进程并发编程的工作。其中包括了:
* [并发原子计数器](/wiki/page/p-atomic.html)
* [并发HashTable](/wiki/page/p-table.html)
* [锁Lock](/wiki/page/p-lock.html)
* [进程间通信IPC](/wiki/page/363.html)
`Swoole`可以广泛应用于互联网、移动通信、企业软件、网络游戏、物联网、车联网、智能家庭等领域。 使用`PHP` + `Swoole`作为网络通信框架,可以使企业`IT`研发团队的效率大大提升,更加专注于开发创新产品。
`Swoole`是开源免费的自由软件,授权协议是`Apache2.0`,企业和个人开发者均可免费使用,并且在`Swoole`之上所作的修改可用于商业产品,无需开源(`注:必须保留原作者的版权声明`)。
开发工具
---
* `Swoole 4.X` 速查表 [https://toxmc.github.io/swoole-cs.github.io/](https://toxmc.github.io/swoole-cs.github.io/)
* `IDE`自动提示工具(自动生成版) :[https://github.com/swoole/ide-helper](https://github.com/swoole/ide-helper)
* 国内`Git`镜像:[https://gitee.com/swoole/swoole](https://gitee.com/swoole/swoole)
* 全量`Markdown`文档: [https://github.com/swoole/swoole-wiki](https://github.com/swoole/swoole-wiki)
* `IDE`自动提示工具(手动版) `swoole-ide-helper`:[https://github.com/eaglewu/swoole-ide-helper](https://github.com/eaglewu/swoole-ide-helper)
交流讨论
----
* `Swoole`官方`QQ`群: `810919826 `
* `Swoole-VIP`群: `626330624`,[终生会员:599 RMB,点击购买](http://phpapp.swoole-cloud.com/app/show?id=EOijt7),请在订单备注中填写您的`QQ`号码
社区资源
----
* **[Github Issue区](https://github.com/swoole/swoole-src/issues) (请按照模板提问, 最快解决渠道)**
* **[Swoole 问答](https://wenda.swoole.com) (推荐使用)**
捐赠 Swoole 开源项目
----
您的捐赠是对`Swoole`项目开发组最大的鼓励和支持。我们会坚持开发维护下去。 您的捐赠将被用于:
* 持续和深入的开发
* 文档和社区的建设和维护
>>> [点击捐赠 Swoole 开源项目](https://gitee.com/swoole/swoole?donate=true)
#### 感谢 [51talk](http://www.51talk.com/) 捐赠 10000元
[](http://www.51talk.com/)
#### 感谢 [codecasts.com](https://codecasts.com/) 捐赠 8000元
[](https://codecasts.com/)
#### 感谢 [六星教育](https://www.sixstaredu.com/) 捐赠 4000元
#### 感谢 [易软天创](http://www.cnezsoft.com/) 捐赠 3000元
#### 感谢[果酱社区](https://guojiang.club/?utm_source=swoole&utm_campaign=sponsor)捐赠

