{"id":34629145,"url":"https://github.com/esd-projects/wechat-plugin","last_synced_at":"2026-06-04T14:31:01.403Z","repository":{"id":56979237,"uuid":"192276400","full_name":"esd-projects/wechat-plugin","owner":"esd-projects","description":"wechat-plugin","archived":false,"fork":false,"pushed_at":"2019-06-17T05:18:51.000Z","size":62,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T14:56:30.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esd-projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-17T04:46:00.000Z","updated_at":"2019-06-28T17:33:16.000Z","dependencies_parsed_at":"2022-08-21T10:50:15.368Z","dependency_job_id":null,"html_url":"https://github.com/esd-projects/wechat-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/esd-projects/wechat-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esd-projects%2Fwechat-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esd-projects%2Fwechat-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esd-projects%2Fwechat-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esd-projects%2Fwechat-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esd-projects","download_url":"https://codeload.github.com/esd-projects/wechat-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esd-projects%2Fwechat-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28004718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T16:33:27.345Z","updated_at":"2025-12-24T16:33:29.635Z","avatar_url":"https://github.com/esd-projects.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESD WeChat Plugin \nESD WeChat Plugin 是一个基于 Swoole 4.x 全协程支持的微信SDK库，告别同步阻塞，轻松编写高性能的微信公众号/小程序/开放平台业务接口\n* EasySwooleDistributed WeChat 是基于 [EasySwoole WeChat](https://github.com/easy-swoole/wechat) 重构，优化并完善；\n\n## 插件安装\n```\n composer require esd/wechat-plugin\n```\n\n\n## 添加 WeChatPlugin 插件\n\n```php\n app/Application 的 main 中添加插件\n\n public static function main()\n  {\n    $application = new GoApplication();\n    $application-\u003eaddPlug(new WeChatPlugin());\n    $application-\u003erun();\n  }\n```\n\n\n\n## 配置参数\n 在application-local.yml 中按需增加配置\n```yaml\nwechat:\n  official_account_config:  #公众号配置\n    app_id: 111111111\n    app_secret: 22222222222222222222\n    ....\n  mini_program_config:  #小程序配置\n    app_id: 111111111\n    app_secret: 22222222222222222222\n  open_platform_config: #开放平台配置\n    app_id: 111111111\n    app_secret: 22222222222222222222\n```\n\n## 获取实例\n 在开始操作之前需要获取一个实例，程序中使用以下方式获取实例\n```php\n use GetWeChat;\n //获取公众号实例\n $wechat = $this-\u003egetOfficialAccount();\n```\n\n## 异常捕获\n\n在调用方法时，如果传递了无效的参数或者发生网络异常，将会抛出 ***ESD\\Plugins\\WeChat\\Exception\\RequestError*** 或者 ***ESD\\Plugins\\WeChat\\Exception\\OfficialAccountError*** 类型的异常，开发者需要手工捕获该类异常进行处理，类似这样：\n\n```php\n\nuse ESD\\Plugins\\WeChat\\Exception\\OfficialAccountError;\nuse ESD\\Plugins\\WeChat\\Exception\\RequestError;\n \n try {\n   $list = $wechat-\u003euser()-\u003elist(); #获取粉丝列表\n } catch (RequestError $requestError){\n    \n } catch (OfficialAccountError $error){\n            \n }\n \n```\n\n\n## 其他\n\n\u003e* 微信公众号沙箱: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login\n\u003e* 微信官方文档：http://mp.weixin.qq.com/wiki\n\u003e* 开放平台文档：https://open.weixin.qq.com\n\u003e* 商户支付文档：https://pay.weixin.qq.com/wiki/doc/api/index.html\n\n\n\nCopyright\n--\n* ESD WeChat Plugin  基于`MIT`协议发布，任何人可以用在任何地方，不受约束\n* ESD WeChat Plugin  部分代码来自互联网，若有异议，可以联系作者进行删除\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesd-projects%2Fwechat-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesd-projects%2Fwechat-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesd-projects%2Fwechat-plugin/lists"}