PaaS web api sdk of php
vhall/paas_sdk
。$ composer require vhall/paas_sdk
Vhall PaaS SDK版本 | PHP 版本 |
---|---|
1.0 | cURL extension, 5.6,7.0 |
1 使用composer形式, (*2)
use Paas\Room; use Paas\Document; include "../vendor/autoload.php"; $config = [ 'appId' => 'xxxx', // 控制台中获取 'secretKey' => 'xxx', // 控制台中获取 'show_request_url' => false, // 是否显示构造请求连接&参数 json console (请勿在生产环境打开) 'show_request_data' => false, // 是否显示接口返回数据 json console (请勿在生产环境打开) ]; // 实例化直播对象 $roomObj = new Room($config); // 创建房间 $resultCreate = $roomObj->create(); // 获取房间列表 $resultList = $roomObj->lists(); // 实例化文档对象 $roomObj = new Document($config); // 文档参数填写 $params = [ // 文档要写绝对路径 'document' => __DIR__. "/test.pptx" ]; // 创建文档 $resultCreate = $roomObj->create($params);
2 直接引入使用, (*3)
use paas\Document; // 直接引入SDK中的的autoload文件 include "../autoload.php"; $config = [ 'appId' => '342a10bb', 'secretKey' => '7b887d97f11cb1f7c6cb890fbecf0367', 'show_request_url' => false, // 是否显示构造请求连接&参数 json console (请勿在生产环境打开) 'show_request_data' => false, // 是否显示接口返回数据 json console (请勿在生产环境打开) ]; $roomObj = new Document($config); $params = [ 'document' => __DIR__. "/test.pptx" ]; $resultCreate = $roomObj->create($params); var_dump($resultCreate);
The MIT License (MIT).详情见 License文件., (*4)