Giter Club home page Giter Club logo

wechat's Introduction

EasySwoole WeChat

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads

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

获取实例

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

 
 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 类型的异常,开发者需要手工捕获该类异常进行处理,类似这样:

 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

wechat's People

Contributors

evalor avatar kiss291323003 avatar lienze741 avatar luffyqaq avatar marber-seven avatar ndj888 avatar runstp avatar sth4me avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.