定制 aardwarq/aardwarq-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

aardwarq/aardwarq-php

Composer 安装命令:

composer require aardwarq/aardwarq-php

包简介

PHP client for aardwarq.com API

README 文档

README

Software License

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-24