Git Product home page Git Product logo

wesdk's Introduction

                         ____
 _      _____  _________/ / /__
| | /| / / _ \/ ___/ __  / //_/
| |/ |/ /  __(__  ) /_/ / ,<
|__/|__/\___/____/\__,_/_/|_|

INSTALL

USE GIT

git clone [email protected]:carolkey/wesdk.git
require path/wesdk/Wesdk.php;

USE COMPOSER

"require":{
    "carolkey/wesdk": "dev-master"
}

REQUIREMENTS

  • php : >= 5.5.0
  • ext-openssl : *
  • ext-curl : *
  • ext-simplexml : *

USAGE

最简单的使用方式:

$mp = new \wesdk\MpBase();
$mp->token = '11111';
$mp->appId = 'wxa40e95db13a91234';
$mp->appSecret = '1639fa0650c155k0b2abc38834a74321';
$mp->encodingAesKey = '7k2kdskafsdfdsfsdfsdfsdfdfsfsd';
$mp->merchantId = '123456';
$mp->merchantKey = '6039fa0650c15520b2abc38834654123';
$mp->reportLevel = 0;
$mp->cainfo = '/data/rootca.pem';
$mp->sslcert = '/data/apiclient_cert.pem';
$mp->sslkey = '/data/apiclient_key.pem';
$mp->debug = true;
 
$wesdk = new \wesdk\Wesdk($mp);
//使用素材管理接口
$media = $wesdk->media;
$media->...

如果有需要自定义缓存、日志打印、自定义运行时目录:

class Mp extends \wesdk\MpBase
{
    public function __construct()
    {
        $this->token = '11111';
        $this->appId = 'wxa40e95db13a91234';
        $this->appSecret = '1639fa0650c155k0b2abc38834a74321';
        $this->encodingAesKey = '7k2kdskafsdfdsfsdfsdfsdfdfsfsd';
        $this->merchantId = '123456';
        $this->merchantKey = '6039fa0650c15520b2abc38834654123';
        $this->reportLevel = 0;
        $this->cainfo = '/data/rootca.pem';
        $this->sslcert = '/data/apiclient_cert.pem';
        $this->sslkey = '/data/apiclient_key.pem';
        $this->debug = true;
    }
    
    public function setCache($key, $value)
    {
        // TODO: 自定义设置你的缓存
    }
    
    public function getCache($key)
    {
        // TODO: 自定义读取你的缓存
    }
    
    public function logger($str, $type)
    {
        // TODO: 自定义写入你的日志
    }
}
 
$wesdk = new \wesdk\Wesdk(new Mp());
//使用素材管理接口
$media = $wesdk->media;
$media->...

具体参数请看文档

DOCUMENTATION

todo

FEATURES

  • 代码库0依赖。
  • 代码遵循PSR-2,PSR-4规范。
  • 支持composer加载 + 内置自动加载器。
  • 支持高并发的TOKEN刷新机制,不会出现高并发下API次数耗尽。
  • 清晰明了的使用方式。
  • 对常用的消息进行封装,IDE代码提示,没有json和xml烦恼。
  • 支持自定义缓存、日志、自定义运行时目录,简便的API错误获取方式,助力你快速调试和开发。

LICENCE

MIT

FEEDBACK

wesdk's People

Contributors

suyar avatar

Stargazers

 avatar ZhiFeng Wang avatar dragoner avatar yuri2 avatar 卧壑 avatar Yurun avatar

Watchers

James Cloos avatar  avatar

Forkers

daxia01 linjinkun

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.