2017 © Pedro Peláez
 

library digits

PHP library for Digits by Twitter

image

sportlobster/digits

PHP library for Digits by Twitter

  • Thursday, January 19, 2017
  • by araines
  • Repository
  • 1 Watchers
  • 1 Stars
  • 37,201 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Digits

Codeship Status for sportlobster/digits-php, (*1)

PHP library for Digits by Twitter., (*2)

Usage

Simple example of server side verification:, (*3)

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., (*4)

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:, (*5)

use Sportlobster\Digits\Client;

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

Contributing

Classes are all specified using PHPSpec. To run:, (*6)

vendor/bin/phpspec run

Integration tests are done via PHPUnit. To run:, (*7)

vendor/bin/phpunit

Code must be to standards. To run:, (*8)

php vendor/bin/php-cs-fixer fix

The Versions

19/01 2017

dev-master

9999999-dev

PHP library for Digits by Twitter

  Sources   Download

MIT

The Requires

 

The Development Requires

19/01 2017

v0.3.0

0.3.0.0

PHP library for Digits by Twitter

  Sources   Download

MIT

The Requires

 

The Development Requires

05/01 2017

v0.2.0

0.2.0.0

PHP library for Digits by Twitter

  Sources   Download

MIT

The Requires

 

The Development Requires

05/01 2017

v0.1.0

0.1.0.0

PHP library for Digits by Twitter

  Sources   Download

MIT

The Requires

 

The Development Requires