amoydavid / powerwechat
微信SDK
Installs: 36 016
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- php: >=7.0
- ext-openssl: *
- ext-simplexml: *
- amoydavid/powerwechat-composer: ^0.1.5
- guzzlehttp/guzzle: ^6.2
- monolog/monolog: ^1.22
- overtrue/socialite: ~2.0
- pimple/pimple: ^3.0
- symfony/cache: ^3.3|^4.0
- symfony/http-foundation: ^2.7|^3.0|^4.0
- symfony/psr-http-message-bridge: ^0.3|^1.0
Requires (Dev)
- mikey179/vfsstream: ^1.6
- mockery/mockery: ^1.0
- overtrue/phplint: dev-master
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-11-12 04:08:59 UTC
README
Base on EasyWeChat(#ba6e21f)
Thanks!
Requirement
- PHP >= 7.0
- Composer
- openssl 拓展
- fileinfo 拓展(素材管理模块需要用到)
Installation
$ composer require "amoydavid/powerwechat" -vvv
Update
目前已经可支持 composer2
Usage
基本使用(以服务端为例):
<?php use PowerWeChat\Factory; $options = [ 'app_id' => 'wx3cf0f39249eb0exxx', 'secret' => 'f1c242f4f28f735d4687abb469072xxx', 'token' => 'powerwechat', 'log' => [ 'level' => 'debug', 'file' => '/tmp/easywechat.log', ], // ... ]; $app = Factory::officialAccount($options); $server = $app->server; $user = $app->user; $server->push(function($message) use ($user) { $fromUser = $user->get($message['FromUserName']); return "{$fromUser->nickname} 您好!欢迎关注 PowerWeChat!"; }); $server->serve()->send();
Contribution
License
MIT