定制 oveleon/youtrack-api-php 二次开发

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

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

oveleon/youtrack-api-php

最新稳定版本:0.1.8

Composer 安装命令:

composer require oveleon/youtrack-api-php

包简介

PHP Adapter for the YouTrack REST API

README 文档

README

This bundle is a PHP wrapper for the YouTrack REST API. It allows communication with your YouTrack instance.

Installation

$ composer require oveleon/youtrack-api-php

Getting Started

use Oveleon\YouTrack\Client;
use Oveleon\YouTrack\HttpClient\HttpClient;

// Create http client to use.
//  You can write your own adapter and use the HttpClientInterface to use e.g. the Guzzle HttpClient.
//  By default, the HttpClient of Symfony is used.
$httpClient = new HttpClient('https://example.myjetbrains.com', 'perm:your-token');

// Create api client
$api = new Client($httpClient);

// Get issues
$issues = $api->issues()
              ->all();

// Refine the query using the filter method
$issues = $api->issues()
              ->filter('state:resolved')
              ->all();

// Cool, but now we would like to specify the return fields...
$issues = $api->issues()
              ->fields(['summary', 'description'])
              ->filter('state:resolved')
              ->all();

// The query on a specific Project can also be refined in exactly the same way
$issues = $api->issues()
              ->filter('state:unresolved')
              ->project('PROJECT_ID');

// The predefined query `findByProject` does nothing more than define a filter for you (In YouTrack the
// filter is described as `query`), so you could also define the following filter to get the same result
$issues = $api->issues()
              ->filter('project:SampleProject')
              ->all();

// Use pagination...
$issues = $api->issues()
              ->paginate(0, 10)
              ->all();

// And now we use another endpoint
$projects = $api->projects()
                ->all();

// ...

Documentation

Read the full Documentation.

References

  • YouTrack REST API Documentation
  • Use Parsedown or other Markdown parsers to convert descriptions of issues and the like into HTML.
  • A simple ticket system based on this API for the open source CMS Contao

Contributing

The API currently supports only a subset of the available options. The basic structure has been prepared so that contributing and adding new endpoints is easy. The structure should be self-explanatory, but feel free to open an issue if you have any questions or comments. Supplementary queries or new entry points must be provided as pull requests.

ToDo:

  • Provide more endpoints
  • Extend existing endpoints (e.g. create Issue)
  • Documentation

统计信息

  • 总下载量: 6.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2023-01-17