定制 comoco/trac-client-php 二次开发

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

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

comoco/trac-client-php

Composer 安装命令:

composer require comoco/trac-client-php

包简介

README 文档

README

a library used for control The Trac Project ticket

Requirements

Example code

<?php

use Comoco\TracClientPhp\Client as TracClient;

$api_url = "http://trac.local/login/jsonrpc";
$username = '<your username>';
$password = '<your password>';

$tracClient = new TracClient($api_url, $username, $password);
$ticket_id = $tracClient->createTicket('my first ticket', 'ticket content', [
    'owner' => 'bob',
    'cc' => 'alice, web',
    'priority' => 'minor'
]);
$tracClient->uploadAttachment($ticket_id, 'example.xml', 'is a example file', "/tmp/example.xml");
$tracClient->addComment($ticket_id, 'It is great!');
$tracClient->resolveTicket($ticket_id, 'ok', 'fixed')

Class Function

getUserTicketIds($username, array $statuses, $limit = 100)

get user own ticket ids

  • $statuses avaliable status could not same on different trac system (based on system setting)
$ticket_ids = $tracClient->getUserTicketIds('bob', ['accepted', 'assigned'], 50);

getTicketInfo($ticket_id)

get ticket information

  • return data could not same on different trac system (based on installed module)
$ticket_id = 1;
$ticket_info = $tracClient->getTicketInfo($ticket_id);

createTicket($summary, $description = '', array $attributes = [])

  • $attributes could not same on different trac system (based on installed module)
$ticket_id = $tracClient->createTicket('my first ticket', 'it is a example ticket', [
    'owner' => 'bob',
    'cc' => 'alice, jack',
    'priority' => 'minor'
]);

updateTicket($ticket_id, $comment = '', array $attributes = [])

update ticket information

  • $attributes could not same on different trac system (based on installed module)
$ticket_id = 1;
$tracClient->updateTicket($ticket_id, 'change ticket content', [
    'summary' => 'my first ticket v2',
    'description' => 'it is a example ticket v2',
    'cc' => 'alice, jack, ellen'
]);

acceptTicket($ticket_id, $comment = '')

accept the ticket

$ticket_id = 1;
$tracClient->acceptTicket($ticket_id, 'accept the ticket');

reassignUser($ticket_id, $username, $comment = '')

reassign ticket to the user

$ticket_id = 1;
$tracClient->reassignUser($ticket_id, 'alice', 'assign ticket to alice');

resolveTicket($ticket_id, $comment = '', $option = 'fixed')

resolve the ticket

  • $option avaliable option could not same on different trac system (it is different based on trac setting)
$ticket_id = 1;
$tracClient->resolveTicket($ticket_id, 'close ticket', 'fixed');

reopenTicket($ticket_id, $comment = '')

reopen the ticket

$ticket_id = 1;
$tracClient->reopenTicket($ticket_id, 'reopen the ticket');

deleteTicket($ticket_id)

delete the ticket

$ticket_id = 1;
$tracClient->deleteTicket($ticket_id);

addComment($ticket_id, $comment)

add comment

$ticket_id = 1;
$tracClient->addComment($ticket_id, 'it is great');

getComments($ticket_id)

get comments

$ticket_id = 1;
$comments = $tracClient->getComments($ticket_id);

listAttachments($ticket_id)

list the ticket's attachments

$ticket_id = 1;
$attachments = $tracClient->listAttachments($ticket_id);

uploadAttachment($ticket_id, $filename, $description, $upload_fila_path)

upload a attachment to the ticket

$ticket_id = 1;
$filename = 'example.xml';
$description = 'demo xml';
$file_path = '/tmp/example.xml';
$tracClient->uploadAttachment($ticket_id, $filename, $description, $file_path)

downloadAttachment($ticket_id, $filename, $save_path)

download the attachment from the ticket

$ticket_id = 1;
$filename = 'example.xml';
$save_path = '/tmp/example.xml';
$tracClient->downloadAttachment($ticket_id, $filename, $save_path)

deleteAttachment($ticket_id, $filename)

delete the attachment from ticket

$ticket_id = 1;
$filename = 'example.xml';
$tracClient->deleteAttachment($ticket_id, $filename)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固