Skip to content

xzncit/developer-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Wechat Development Framework

如果本PHP WeChat 开发包对您有所帮助,您可以点右上角 "Star" 支持一下 谢谢!

环境要求

  • PHP >= 7.2.5
  • Composer
  • Openssl PHP Extension
  • MBstring PHP Extension
  • FileInfo PHP Extension

安装

composer require "xzncit/developer-tools:^0.5.4"

基本使用

include "vendor/autoload.php";

use xzncit\Factory;

try {
    // wechat 
    $app = Factory::Wechat([
        "token"=>"omJNpZEhZ5VFbk1HeHj1ZxFECKkP48BP",
        "appid"=>"wxa02e77d8a507d608",
        "appsecret"=>"3396f50c1f55c2089f4316b6f7c9f71b"
    ]);
    
    // 创建自定义菜单
    $response = $app->menu->create([
        // ...
    ]);
    
    // 返回信息
    var_dump($response);
}catch (\Exception $ex){
    echo("error: ".$ex->getMessage());
}

try {
    // mini
    $app = Factory::MiniProgram([
        "appid"=>"wxa02e77d8a507d608",
        "appsecret"=>"3396f50c1f55c2089f4316b6f7c9f71b"
    ]);
    
    // 登录凭证校验
    $response = $app->oauth->code2Session("31f55c2089f4316b6");
    
    // 返回信息
    var_dump($response);
}catch (\Exception $ex){
    echo("error: ".$ex->getMessage());
}

文档

文档整理中...

bug反馈

如果您使用过程中发现BUG或者其他问题都欢迎大家提交Issue,或者发送邮件给我 158373108@qq.com,我们将及时修复并更新。

About

PHP Development Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages