承接 sportlobster/digits 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sportlobster/digits

Composer 安装命令:

composer require sportlobster/digits

包简介

PHP library for Digits by Twitter

README 文档

README

Codeship Status for sportlobster/digits-php

PHP library for Digits by Twitter.

Usage

Simple example of server side verification:

use Sportlobster\Digits\Client;
use Sportlobster\Digits\Exception\AuthenticationException;

$client = Client('YOUR_DIGITS_CONSUMER_KEY');

// Verify a user via OAuth Echo
try {
    $user = $client->verify($echoUrl, $echoAuth);
} catch (AuthenticationException $e) {
    // User could not be authenticated
}

// Get details about the user
$user->getId();
$user->getPhoneNumber();

// Get details about the user's OAuth token
$accessToken = $user->getAccessToken();
$accessToken->getToken();
$accessToken->getSecret();

The underlying HTTP client (Guzzle) can be configured. This allows the ability to set request timeout options, proxies etc.

use Sportlobster\Digits\Client;

// See http://docs.guzzlephp.org/en/latest/request-options.html
$options = [
    'connect_timeout' => 3.14,
    'proxy' => 'tcp://localhost:8125',
];

$client = Client('YOUR_DIGITS_CONSUMER_KEY', $options);

In some scenarios you may have more than one set of Digits Keys that you wish to permit signing via (e.g. an iOS app and an Android app which share the same API service). In this case you can pass an array of keys to the Client instead:

use Sportlobster\Digits\Client;

$client = Client(['KEY1', 'KEY2', ...]);

Contributing

Classes are all specified using PHPSpec. To run:

vendor/bin/phpspec run

Integration tests are done via PHPUnit. To run:

vendor/bin/phpunit

Code must be to standards. To run:

php vendor/bin/php-cs-fixer fix

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固