mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-03 12:17:48 +08:00
Added easywechat.
This commit is contained in:
parent
a651d9bd8a
commit
53c58a99f2
27
doc/zh/sdks/wechat.md
Normal file
27
doc/zh/sdks/wechat.md
Normal file
@ -0,0 +1,27 @@
|
||||
# EasyWechat
|
||||
|
||||
EasyWeChat 是一个开源的 微信 非官方 SDK。
|
||||
|
||||
> 因为组件默认使用 `Curl`,所以我们需要修改对应的 `GuzzleClient` 为协程客户端,或者修改常量 `SWOOLE_HOOK_FLAGS` 为 `SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL`
|
||||
|
||||
## 替换 `Handler`
|
||||
|
||||
以下以小程序为例,
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
$app = Factory::miniProgram($config);
|
||||
$app['guzzle_handler'] = CoroutineHandler::class;
|
||||
```
|
||||
|
||||
## 修改 `SWOOLE_HOOK_FLAGS`
|
||||
|
||||
修改入口文件 `bin/hyperf.php`,以下忽略不需要修改的代码。
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
||||
|
||||
```
|
@ -81,6 +81,10 @@
|
||||
* [枚举类](zh/constants.md)
|
||||
* [Snowflake](zh/snowflake.md)
|
||||
|
||||
* 第三方组件
|
||||
|
||||
* [EasyWechat](zh/sdks/wechat.md)
|
||||
|
||||
* 应用部署
|
||||
|
||||
* [Docker Swarm 集群搭建](zh/tutorial/docker-swarm.md)
|
||||
|
Loading…
Reference in New Issue
Block a user