tb07/open-kuaishou

There is no license information available for the latest version (1.0.3) of this package.

快手sdk

1.0.3 2022-08-10 03:03 UTC

This package is auto-updated.

Last update: 2024-05-10 07:13:24 UTC


README

安装 - install

$ composer require tb07/open-kuaishou

使用 - usage

require 'vendor/autoload.php';

$app = new Tb07\OpenKuaiShou\OpenKuaiShou([  
            'debug' => true,
            'appKey' => 'your app key',
            'appSecret' => 'your app secret'
            'signSecret' => 'your sign Secret'
            'messageSecretKey' => 'your message Secret Key'
]);

// 创建授权
$app->ksAuthorization->createPcAuthUrl('https://www.test.com/authorization');

// 部分API没有封装成具体方法,你也可以自行调用 request 方法
$app->request('请求方式','方法', ['参数'=> '值'],'授权凭证');

测试 - tests

  1. 复制 phpunit.xml 配置文件
    $ cp example.phpunit.xml phpunit.xml
  2. 修改配置文件环境变量部分
    <php>
        <env name="kuaiShou.appKey" value="your app key"/>
        <env name="kuaiShou.appSecret" value="your app secret"/>
        <env name="kuaiShou.signSecret" value="your sign Secret"/>
        <env name="kuaiShou.messageSecretKey" value="your message Secret Key"/>
        <env name="kuaiShou.adZoneId" value="your ad zone id"/>
    </php>
  3. 执行测试用例
    $ vendor/bin/phpunit