PHPackages                             limingxinleo/swoft-easywechat - 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. [API Development](/categories/api)
4. /
5. limingxinleo/swoft-easywechat

ActiveLibrary[API Development](/categories/api)

limingxinleo/swoft-easywechat
=============================

Swoft EasyWeChat扩展

1.0.0(7y ago)212MITPHPPHP &gt;=7.0

Since Aug 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/limingxinleo/swoft-easywechat)[ Packagist](https://packagist.org/packages/limingxinleo/swoft-easywechat)[ RSS](/packages/limingxinleo-swoft-easywechat/feed)WikiDiscussions master Synced today

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

Swoft EasyWeChat
================

[](#swoft-easywechat)

本仓库不再维护，请使用者直接使用 `overtrue/wechat`。 并且配置composer.json。

```
"repositories": {
    "guzzle": {
        "type": "git",
        "url": "https://github.com/limingxinleo/guzzle.git"
    }
}

```

上述仓库，增加SwolleCoroutineHandler，当扩展跑在swoole协程下时，会自动使用该Handler处理请求。 当使用wechat server功能时，只需要自己初始化request即可。

```
/** @var \EasyWeChat\OfficialAccount\Application $app */
$app = OfficialAccount::instance()->app;

$get = $request->getSwooleRequest()->get ?? [];
$post = $request->getSwooleRequest()->post ?? [];
$attr = [];
$cookies = $request->getSwooleRequest()->cookie ?? [];
$files = $request->getSwooleRequest()->files ?? [];
$server = $request->getSwooleRequest()->server ?? [];
$raw = $request->getSwooleRequest()->rawContent();

// 初始化 Request
$app->request->initialize($get, $post, $attr, $cookies, $files, $server, $raw);

```

用法与EasyWeChat没有区别，请实现自己的基于协程的单例。

```
