causelabs/tempo-php-sdk

一个PHP SDK,用于简化与Atlassian Tempo servlet API的交互

v1.1 2016-10-14 21:57 UTC

This package is auto-updated.

Last update: 2024-09-10 04:38:02 UTC


README

本包提供了一个(目前)非常简单的接口,允许从Atlassian JIRA Tempo servlet API检索Tempo工作日志。

安装

使用composer完成安装

composer require causelabs/tempo-php-sdk

使用方法

使用API分为两个步骤:创建传输客户端,并将它传递给API。

传输客户端

最简单的方法是使用包含的基于Guzzle的客户端。如果你想要创建自己的客户端,只需实现CauseLabs\Interfaces\ClientInterface

use CauseLabs\TempoAPI\GuzzleClient;

$url = 'https://yourjirainstance.jira.com';
$key = 'your-tempo-api-key';

$client = new GuzzleClient($url, $key);

API实例化

实例化客户端后,你可以设置API连接

use CauseLabs\TempoAPI\GuzzleClient;
use CauseLabs\TempoAPI\API;

$url = 'https://yourjirainstance.jira.com';
$key = 'your-tempo-api-key';

$client = new GuzzleClient($url, $key);
$api = new API($client);

// Get worklogs for a specific user
$username = 'john_doe';
$start = new DateTime;
$end = new DateTime;

$worklogs = $api->worklogs($username, $start, $end);

许可证

MIT

联系

有关贡献、提问等事宜,请联系Mark Horlbeck,邮箱:mark@causelabs.com