定制 jakoch/php-trac-rpc 二次开发

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

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

jakoch/php-trac-rpc

Composer 安装命令:

composer require jakoch/php-trac-rpc

包简介

A library to interact with a Trac Bugtracker API via remote procedure calls.

README 文档

README

TracRPC

Latest Stable Version Total Downloads Build Status License

The purpose of this class is to interact with the Trac API from a remote location by remote procedure calls.

Trac is a project management and bug/issue tracking system. http://trac.edgewall.org/

Trac by itself does not provide an API. You must install the XmlRpcPlugin. Trac then provides anonymous and authenticated access to the API via two protocols XML-RPC and JSON-RPC. http://trac-hacks.org/wiki/XmlRpcPlugin/

Requirements

  • PHP 5.3.0 or higher
  • The PHP Extensions "JSON" and "cURL" are required.
  • Trac with XmlRpcPlugin

Features

Installation

a) Download the ZIP from Github, then extract the library file and include it.

b) Installation via Composer

To add PHPTracRPC as a local, per-project dependency to your project, simply add jakoch/php-trac-rpc to your project's composer.json file.

{
    "require": {
        "jakoch/php-trac-rpc": "dev-master"
    }
}

Usage

Step 1: include library

When you installed via Composer, please include the Composer Autoloader first and then instantiate the TracRPC class.

include __DIR__.'/vendor/autoload.php';

When you fetched the zip file, please include the lib directly.

include __DIR__.'/lib/TracRPC.php';

Step 2: setup credentials and instantiate TracRPC

$credentials = array('username' => 'username', 'password' => 'password');

$trac = new \TracRPC\TracRPC('http://trac.example.com/login/jsonrpc', $credentials);

Step 3: do some requests

Single Call Example
$result = $trac->getTicket('32');

if ($result === false) {
    die('ERROR: '.$trac->getErrorMessage());
} else {
    var_dump($result);
}
Multi Call Example
$trac->setMultiCall(true);

$ticket = $trac->getTicket('32');
$attachments = $trac->getTicketAttachments('list', '32');

$trac->doRequest();

$ticket = $trac->getResponse($ticket);
$attachments = $trac->getResonse($attachments);
var_dump($ticket, $attachments);

Request Methods

  1. getRecentChangedWikiPages($date = 0)
  2. getWikiPage($name = '', $version = 0, $raw = true)
  3. getWikiPageInfo($name = '', $version = 0)
  4. getWikiPages()
  5. getRecentChangedTickets($date = 0)
  6. getTicket($id = '')
  7. getTicketFields()
  8. getTicketChangelog($id = '', $when = 0)
  9. getTicketActions($id = '')
  10. getWikiAttachments($action = 'list', $name = '', $file = '')
  11. getTicketAttachments($action = 'list', $id = '', $file = '', $desc = '', $replace = true)
  12. getWikiUpdate($action = 'create', $name = '', $page = '', $data = array())
  13. getTicketUpdate($action = 'create', $id = '', $data = array())
  14. getTicketSearch($query = '')
  15. getTicketComponent($action = 'get_all', $name = '', $attr = array())
  16. getTicketMilestone($action = 'get_all', $name = '', $attr = array())
  17. getTicketPriority($action = 'get_all', $name = '', $attr = '')
  18. getTicketResolution($action = 'get_all', $name = '', $attr = '')
  19. getTicketSeverity($action = 'get_all', $name = '', $attr = '')
  20. getTicketType($action = 'get_all', $name = '', $attr = '')
  21. getTicketVersion($action = 'get_all', $name = '', $attr = array())
  22. getTicketStatus()
  23. getSearch($query = '', $filter = array())
  24. getWikiTextToHTML($text = '')
  25. getSearchFilters()
  26. getApiVersion()

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固