vision-rhythm/douyin-open-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vision-rhythm/douyin-open-php

Composer 安装命令:

composer require vision-rhythm/douyin-open-php

包简介

VisionRhythm php Library

README 文档

README

You can sign up for a MasJPay account at https://www.visionrhythm.com/.

Requirements

PHP 5.6.0 and later.

Composer

You can install the bindings via Composer. Run the following command:

composer require vision-rhythm/douyin-open-php

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.

require_once('/path/to/douyin-open-php/init.php');

Dependencies

The bindings require the following extensions in order to work properly:

  • curl, although you can use your own non-cURL client if you prefer
  • json
  • mbstring (Multibyte String)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started

Simple usage looks like:

const CLIENT_ID = '';
const CLIENT_SECRET = '';

\Visionrhythm\VisionRhythm::setDebug(true); //调试模式   true /false
\Visionrhythm\VisionRhythm::setApiMode('sandbox'); //环境  live 线上,sandbox 沙盒
\Visionrhythm\VisionRhythm::setclientId(CLIENT_ID);    // 设置 id
\Visionrhythm\VisionRhythm::setclientSecret(CLIENT_SECRET);   // secret
\VisionRhythm\VisionRhythm::setRedirectUri(''); //回调地址


$open_id = '';
$access_token = '';

try {

    $userInfo = \VisionRhythm\User::info($open_id, $access_token);
    echo($userInfo)."\r\n";

    $fans = \VisionRhythm\User::fans($open_id, $access_token, 0, 10);
    echo($fans)."\r\n";

    $following = \VisionRhythm\User::following($open_id, $access_token, 0, 10);
    echo($following)."\r\n";

} catch (\Visionrhythm\Error\Base $e) {
    if ($e->getHttpStatus() != null) {
        header('Status: ' . $e->getHttpStatus());
        echo $e->getHttpBody();
    } else {
        echo $e->getMessage();
    }
}

Development

Get [Composer][composer]. For example, on Mac OS:

brew install composer

Install dependencies:

composer install

Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:

./vendor/bin/phpunit

Or to run an individual test file:

./vendor/bin/phpunit tests/UtilTest.php

The method should be called once, before any request is sent to the API. The second and third parameters are optional.

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固