aardwarq/aardwarq-php
Composer 安装命令:
composer require aardwarq/aardwarq-php
包简介
PHP client for aardwarq.com API
README 文档
README
This is the PHP API client for Aardwarq.com.
Install
Via Composer
$ composer require aardwarq/aardwarq-php
Usage
// Configure Aardwarq API Client $provider = new Aardwarq\Api\OAuth2Provider([ 'clientId' => 'CLIENT_ID', 'clientSecret' => 'CLIENT_SECRET', 'redirectUri' => 'http://aardwarq.com/' ]); $token = $provider->getAccessToken('clientCredentials'); $api = new Aardwarq\Api\Client($token->accessToken); // You can set defaults for every event \Aardwarq\Api\Event\Event::setDefaults([ 'context' => 'CLI', // 'environment' => 'development', 'version' => 'v0.1.1', // Version of your app ]); // Register exception handler set_exception_handler(function (\Exception $exception) use ($api) { echo 'Handling!'; $apiException = new \Aardwarq\Api\Event\Exception(); $apiException ->setMessage($exception->getMessage()) ->setStackTrace($exception->getTrace()) ; $result = $api->send($apiException); });
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-24