2017 © Pedro Peláez
 

library wechat

微信SDK

image

feicanfly/wechat

微信SDK

  • Friday, July 22, 2016
  • by feicanfly
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1778 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

Easy WeChat

可能是目前最优雅的微信公众平台 SDK 了。, (*1)

不支持企业号,也不打算支持,原因?微信的API实在设计得太乱了,我怕累死。。。, (*2)

  • SDK 官方论坛:https://forum.easywechat.org
  • SDK 使用交流 QQ 群:319502940
  • 微信开发者交流 QQ 群:9179779

Build Status Latest Stable Version Latest Unstable Version Build Status Scrutinizer Code Quality Code Coverage Total Downloads License, (*3)

特点

  • 命名不那么乱七八糟;
  • 隐藏开发者不需要关注的细节;
  • 方法使用更优雅,不必再去研究那些奇怪的的方法名或者类名是做啥用的;
  • 自定义缓存方式;
  • 符合 PSR 标准,你可以各种方便的与你的框架集成;
  • 高度抽象的消息类,免去各种拼json与xml的痛苦;
  • 详细 Debug 日志,一切交互都一目了然;

环境要求

  1. PHP >= 5.5.9
  2. composer
  3. openssl 拓展
  4. fileinfo 拓展(素材管理模块需要用到)

SDK 对所使用的框架并无特别要求, (*4)

安装

composer require "overtrue/wechat:~3.1" -vvv

使用

基本使用(以服务端为例):, (*5)

<?php

use EasyWeChat\Foundation\Application;

$options = [
    'debug'     => true,
    'app_id'    => 'wx3cf0f39249eb0e60',
    'secret'    => 'f1c242f4f28f735d4687abb469072a29',
    'token'     => 'easywechat',
    'log' => [
        'level' => 'debug',
        'file'  => '/tmp/easywechat.log',
    ],
    // ...
];

$app = new Application($options);

$server = $app->server;
$user = $app->user;

$server->setMessageHandler(function($message) use ($user) {
    $fromUser = $user->get($message->FromUserName);

    return "{$fromUser->nickname} 您好!欢迎关注 overtrue!";
});

$server->serve()->send();

更多请参考http://easywechat.org/。, (*6)

文档

http://easywechat.org/, (*7)

强烈建议看懂微信文档后再来使用本 SDK。, (*8)

框架集成

Laravel 5 拓展包: overtrue/laravel-wechat, (*9)

贡献代码

贡献指南, (*10)

License

MIT, (*11)

The Versions

16/07 2016

2.1.x-dev

2.1.9999999.9999999-dev

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

The Development Requires

by Avatar overtrue

sdk weixin wechat weixin-sdk

19/02 2016

3.0.1

3.0.1.0

微信SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar overtrue

sdk weixin wechat weixin-sdk

17/02 2016

3.0

3.0.0.0

微信SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar overtrue

sdk weixin wechat weixin-sdk

18/08 2015

2.0.x-dev

2.0.9999999.9999999-dev

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

18/08 2015

2.1.0

2.1.0.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

11/08 2015

2.0.35

2.0.35.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

08/05 2015

2.0.1

2.0.1.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

07/05 2015

2.0.0

2.0.0.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-mcrypt *

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

19/03 2015

1.0.1

1.0.1.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Avatar overtrue

sdk weixin wechat weixin-sdk

13/03 2015

1.0

1.0.0.0

微信SDK

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Avatar overtrue

sdk weixin wechat weixin-sdk