开发者

Get a list of bugzilla bugs in PHP

开发者 https://www.devze.com 2023-02-03 22:53 出处:网络
Is it possible to get a list of all new bugs from a bugzilla installation via PHP? I can see that there is the xmlrpc.cgi file开发者_StackOverflow but I can\'t find any examples of how to use it

Is it possible to get a list of all new bugs from a bugzilla installation via PHP? I can see that there is the xmlrpc.cgi file开发者_StackOverflow but I can't find any examples of how to use it

Any help appreciated Thanks!


Example how to do it with Zend_Http_Client. You can do it with raw PHP as well. http://petehowe.co.uk/2010/02/23/example-of-calling-the-bugzilla-api-using-php-zend-framework/


I actually figured out that I can get raw XML using...

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


Is this what you're looking for, XMLRPC Bugzilla

Example XMLRPC Call:

<?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);

?>
0

精彩评论

暂无评论...
验证码 换一张
取 消