Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: easy-swoole/wechat
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.2.1
Choose a base ref
...
head repository: easy-swoole/wechat
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.2.x
Choose a head ref
  • 14 commits
  • 15 files changed
  • 7 contributors

Commits on May 22, 2020

  1. 公众号数据统计

    lienze741 committed May 22, 2020
    Copy the full SHA
    ab34818 View commit details
  2. Copy the full SHA
    1bd4028 View commit details

Commits on May 23, 2020

  1. Merge pull request #68 from lienze741/1.2.x

    公众号数据统计
    kiss291323003 authored May 23, 2020
    Copy the full SHA
    566a53b View commit details

Commits on Oct 23, 2020

  1. Copy the full SHA
    b3472fa View commit details
  2. Merge pull request #72 from RunsTp/1.2.x

    ✨ 小程序支持自定义AccessToken
    RunsTp authored Oct 23, 2020
    Copy the full SHA
    9c0187a View commit details

Commits on Nov 17, 2020

  1. issue #420

    Player626 committed Nov 17, 2020
    Copy the full SHA
    9829c9b View commit details
  2. Merge pull request #74 from gaobinzhan/1.2.x

    issue #420
    Player626 authored Nov 17, 2020
    Copy the full SHA
    1a9044f View commit details

Commits on Nov 25, 2020

  1. fix: qrcode create expire_seconds

    Player626 authored and RunsTp committed Nov 25, 2020
    Copy the full SHA
    eaab707 View commit details
  2. fix: qrcode

    Player626 authored and RunsTp committed Nov 25, 2020
    Copy the full SHA
    dac28e6 View commit details

Commits on Feb 26, 2021

  1. add miniprogram urlscheme api

    lidanyang committed Feb 26, 2021
    Copy the full SHA
    0e49ea2 View commit details
  2. Merge pull request #106 from LinkedDestiny/1.2.x

    add miniprogram urlscheme api
    kiss291323003 authored Feb 26, 2021
    Copy the full SHA
    1c664dd View commit details

Commits on Mar 30, 2021

  1. Copy the full SHA
    66cee0a View commit details

Commits on May 30, 2021

  1. Add:add wechat 1.2.x docs

    XueSiLf committed May 30, 2021
    Copy the full SHA
    e3d5e26 View commit details

Commits on May 31, 2021

  1. Merge pull request #143 from XueSiLf/1.2.x

    Add:add wechat 1.2.x docs
    Player626 authored May 31, 2021
    Copy the full SHA
    7039bbd View commit details
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
vendor/
composer.lock
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,42 +6,45 @@
[![License](https://poser.pugx.org/easyswoole/wechat/license)](https://packagist.org/packages/easyswoole/wechat)
[![Monthly Downloads](https://poser.pugx.org/easyswoole/wechat/d/monthly)](https://packagist.org/packages/easyswoole/wechat)

EasySwoole WeChat 是一个基于 Swoole 4.x 全协程支持的微信SDK库,告别同步阻塞,轻松编写高性能的微信公众号/小程序/开放平台业务接口
`EasySwoole WeChat 1.2.x` 是一个基于 `Swoole 4.x` 全协程支持的微信 `SDK` 库,告别同步阻塞,轻松编写高性能的微信公众号/小程序/开放平台业务接口

## 文档说明

- [组件安装](docs/install.md)
- [公众号组件文档](docs/officialAccount.md)
- [小程序组件文档](docs/miniProgram.md)

## 获取实例

在开始操作之前需要获取一个实例,后续操作均使用该实例进行操作
在开始操作之前需要先获取一个实例,后续操作均使用该实例进行操作

```php

use EasySwoole\WeChat\WeChat;
use EasySwoole\WeChat\Config;

$wechat = new WeChat(); // 创建一个实例
$wechat->config()->setTempDir(EASYSWOOLE_TEMP_DIR); // 指定全局临时目录
<?php
use EasySwoole\WeChat\WeChat;
use EasySwoole\WeChat\Config;

$wechat = new WeChat(); // 创建一个实例
$wechat->config()->setTempDir(EASYSWOOLE_TEMP_DIR); // 指定全局临时目录
```

## 异常捕获

在调用方法时,如果传递了无效的参数或者发生网络异常,将会抛出 ***EasySwoole\WeChat\Exception\RequestError*** 或者 ***EasySwoole\WeChat\Exception\OfficialAccountError*** 类型的异常,开发者需要手工捕获该类异常进行处理,类似这样
在调用方法时,如果传递了无效的参数或者发生网络异常,将会抛出 ***\EasySwoole\WeChat\Exception\RequestError*** 或者 ***\EasySwoole\WeChat\Exception\OfficialAccountError*** 类型的异常,开发者需要手动捕获该类异常进行处理,类似如下这样

```php

use EasySwoole\WeChat\Exception\RequestError;
use EasySwoole\WeChat\Exception\OfficialAccountError;

try {
$wechat->officialAccount()->ipList();
} catch (RequestError $requestError){

} catch (OfficialAccountError $error){

}

<?php
use EasySwoole\WeChat\Exception\RequestError;
use EasySwoole\WeChat\Exception\OfficialAccountError;

try {
$wechat->officialAccount()->ipList();
} catch (RequestError $requestError){

} catch (OfficialAccountError $error){

}
```


## 微信公众号

微信公众号沙箱: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
微信公众号沙箱: [https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login](https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login)
31 changes: 31 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: easyswoole微信SDK
meta:
- name: description
content: easyswoole微信SDK
- name: keywords
content: easyswoole微信SDK|swoole微信SDK
---


# 微信 SDK EasySwoole WeChat 1.2.x

`EasySwoole WeChat` 是一个基于 `Swoole 4.x 全协程` 支持的微信 `SDK` 库,告别同步阻塞,轻松编写高性能的微信公众号/小程序/开放平台业务接口。

## 组件要求

- php >= 7.1.0
- easyswoole/component >= 1.0
- easyswoole/spl >= 1.3.7
- easyswoole/http-client ^1.0
- easyswoole/utility" ^1.0

## 安装方法

> ```
> composer require easyswoole/wechat=1.2.x
> ```
## 仓库地址
[easyswoole/wechat=1.2.x](https://github.com/easy-swoole/wechat)
Loading