kokoroe/kokoroe-sdk-php

PHP版的Kokoroe SDK

v1.0.0-alpha.4 2016-06-15 08:16 UTC

README

Build Status SensioLabs Insight Coveralls HHVM Packagist

安装

kokoroe/kokoroe-sdk-php 添加到您的 composer.json

% php composer.phar require kokoroe/kokoroe-sdk-php:~1.0

用法

示例

<?php

$kokoroe = new Kokoroe\Kokoroe([
    'client_id'             => '{client-id}',
    'client_secret'         => '{client-secret}',
    'country'               => 'FR',
    'locale'                => 'fr',
    'user_ip'               => $_SERVER['REMOTE_ADDR'], // use real ip of user.
    'default_access_token'  => '{access-token}', // optional
    'signature'             => true // optional
]);

// If you provided a 'default_access_token', the '{access-token}' is optional.
$response = $kokoroe->get('/me', '{access-token}');

if ($response->isSuccessful()) {
    var_dump($response->getContent()); // dump array
}

?>

选项

许可协议

kokoroe-sdk-php 在 MIT 许可协议 下发布。