atehnix/vk-client 问题修复 & 功能扩展

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

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

atehnix/vk-client

最新稳定版本:1.4.0

Composer 安装命令:

composer require atehnix/vk-client

包简介

PHP client for Vk.com API

README 文档

README

GitHub license Packagist Version Packagist Stats

Installation

You can get library and all of it dependencies through composer

composer require atehnix/vk-client

Usage

Simple example

    $api = new Client;

    $response = $api->request('wall.get', ['owner_id' => 1]);

Use Request class

    $api = new Client;

    $request = new Request('wall.get', ['owner_id' => 1]);
    $response = $api->send($request);

Use ExecuteRequest class

Send multiple requests at once

    $api = new Client;

    $execute = ExecuteRequest::make([
        new Request('wall.get', ['owner_id' => 1]),
        new Request('wall.get', ['owner_id' => 2]),
        // ... few requests
        new Request('wall.get', ['owner_id' => 25]),
    ]);

    $response = $api->send($execute);

Use a specific version of the API.

  $api = new Client('5.60');

Use with access token

Set default token in client.

    $api = new Client;

    $api->setDefaultToken("some_token");

    // ...

Or set token for specific request.

    $api = new Client;

    // Token in the request is a higher priority than the default token.
    $request = new Request('wall.get', ['owner_id' => 1], "some_token");

    // ...

Authorization

    $auth = new Auth('client_id', 'client_secret', 'redirect_uri');

    echo "<a href='{$auth->getUrl()}'>ClickMe<a>";

    // ...

    $token = $auth->getToken($_GET['code']);

License

MIT

统计信息

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

GitHub 信息

  • Stars: 60
  • Watchers: 9
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-31