PHP code example of lzhy / cloudmarket
1. Go to this page and download the library: Download lzhy/cloudmarket library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lzhy / cloudmarket example snippets
use Lzhy\Cloudmarket\Market;
/** $cloud取值:jd/bce/hce/tce/ksyun **/
$market = new Market($cloud,$keyortoken) //百度
$market->checkSign(); //效验
$market->input($unify = false); //参数$unify 是否统一部分参数
//除了百度,华为、金山之外可自行返回json
$market->response($data); //包装返回
use Lzhy\Cloudmarket\Support\Bce;
use Lzhy\Cloudmarket\Support\Hce;
use Lzhy\Cloudmarket\Support\Jd;
use Lzhy\Cloudmarket\Support\Ksyun;
use Lzhy\Cloudmarket\Support\Tce;
//以百度为例
$bMarket = new Bce($keyortoken);
$bMarket->checkSign(); //效验
$bMarket->unify(false)->input($parse = false); //请求参数 如果是金山云或华为云请传入true解析敏感加密数据
//除了百度,华为、金山之外可自行返回json
$bMarket->response($data); //返回