2017 © Pedro Peláez
 

library latch-sdk-php

PHP SDK for latch API with composer and guzzle

image

fourcoders/latch-sdk-php

PHP SDK for latch API with composer and guzzle

  • Wednesday, January 14, 2015
  • by jorgemarcial
  • Repository
  • 4 Watchers
  • 0 Stars
  • 100 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SensioLabsInsight, (*1)

latch-sdk-php

Latch SDK php with Guzzle., (*2)

This library is 100% compatible with proyects with the original latch sdk https://github.com/ElevenPaths/latch-sdk-php. The feature of our library is that you can load it with the modern Composer system., (*3)

Installation

Install via Composer, (*4)

{
    "require": {
        "fourcoders/latch-sdk-php": "dev-master"
    }
}

Autoloading

Composer generates a vendor/autoload.php file. You can simply include this file and you will get autoloading for free., (*5)

require 'vendor/autoload.php';

Usage

Extract and modify of original php sdk https://github.com/ElevenPaths/latch-sdk-php#using-the-sdk-in-php

Create a Latch object with the "Application ID" and "Secret" previously obtained., (*6)

    $api = new \Fourcoders\LatchSdk\Latch(APP_ID, APP_SECRET);

Optional settings:, (*7)

    $api->setProxy(YOUR_PROXY);

Call to Latch Server. Pairing will return an account id that you should store for future api calls, (*8)

     $pairResponse = $api->pair("PAIRING_CODE_HERE");
     $statusResponse = $api->status(ACCOUNT_ID_HERE);
     $unpairResponse = $api->unpair(ACCOUNT_ID_HERE);

After every API call, get Latch response data and errors and handle them., (*9)

```php $pairResponse->getData(); $pairResponse->getError();, (*10)

The Versions

14/01 2015

dev-master

9999999-dev

PHP SDK for latch API with composer and guzzle

  Sources   Download

MIT

The Requires

 

latch fourcoders