Bugzilla has a rudimentary API for driving it from code. To do this from PHP is reasonably trivial, but using Zend Framework (for the cookie jar primarily) makes the task very simple. Here is some example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | $oClient = new Zend_XmlRpc_Client('http://my.zilla.url/xmlrpc.cgi'); $oHttpClient = new Zend_Http_Client(); $oHttpClient->setCookieJar(); $oClient->setHttpClient($oHttpClient); $aResponse = $oClient->call('User.login', array(array( 'login' => 'peterh@mydomain.com', 'password' => 'mypassword', 'remember' => 1 ))); $aResponse = $oClient->call('Bug.create', array(array( 'product' => "My Product", 'component' => "My Component", 'summary' => "This is the summary of the bug I'm creating", 'version' => "unspecified", 'description' => "This is a description of the bug", 'op_sys' => "All", 'platform' => "---", 'priority' => "P5", 'severity' => "Trivial" ))); $iBugId = $aResponse['id']; $aResponse = $oClient->call('User.logout'); |
Hey there,
thanks for this post.
This is my first task, which is going to work with the Zend-Framework, I would like to read a Bug of Bugzilla, getting the version-number is working, but Bug.get_bugs (Bugzilla 3.0.4) doesn’t.
But at all: now I am playing with the Zend framework, let’s have a look if I can use it in private projects ;P
PS: is the Zend Framework that slow, that reading the Bugzilla version takes 5 second or is this the windows machine which is my working machin?