2011-01-10 45 views
2

是否可以通过PHP获取bugzilla安装中的所有新bug的列表? 我可以看到有xmlrpc.cgi文件,但我找不到如何使用它的任何示例获取PHP中的bugzilla错误列表

任何帮助赞赏 谢谢!

回答

2

其实我想通了,我可以用得到的原始XML ...

/buglist.cgi?ctype=atom&bug_status=NEW 
2

这是你在找什么,XMLRPC Bugzilla

示例XML-RPC调用:

<?php 
// Add the Zend Library, make sure this is installed: sudo apt-get install libzend-framework-php 
ini_set("include_path", "/usr/share/php/libzend-framework-php"); 

// Add the AutoLoader, Calls any Library that's needed 
require_once('Zend/Loader/Autoloader.php'); 
Zend_Loader_Autoloader::getInstance(); 

// New client that calls your Bugzilla XMLRPC server 
$server = new Zend_XmlRpc_Client('http://bugzilla.yourdomain.com/xmlrpc.cgi'); 
$client = $server->getProxy(); 

// Create the Multi-Call array request 
$request = array(
    array(
     'methodName' => 'system.listMethods', 
     'params'  => array() 
    )); 

/* 
// Example: Multi call array format 
$request = array(
    array(
     'methodName' => 'system.listMethods', 
     'params'  => array() 
    ), 
    array(
     'methodName' => 'your_service.your_function', 
     'params'  => array('parm') 
    )); 

*/ 

// $response is an array() 
$response = $client->system->multicall($request); 

// Print the array 
echo print_r($response,true); 

?>