Skip to content

Instantly share code, notes, and snippets.

@sbarrat
Created January 31, 2012 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbarrat/1709587 to your computer and use it in GitHub Desktop.
Save sbarrat/1709587 to your computer and use it in GitHub Desktop.
XMLRPC_Client Bugzilla with Zend Framework
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
$server = 'http://bugzilla.mydomain.com/xmlrpc.cgi';
$client = new Zend_XmlRpc_Client( $server );
// Create the http client
$httpClient = new Zend_Http_Client();
$httpClient->setCookieJar();
$client->setHttpClient( $httpClient );
// Bugzilla Login
$params = new Zend_XmlRpc_Value_Struct(
array(
'login' => 'bugzilla@mydomain.com',
'password' => 'mypassword',
'remember' => 1
)
);
$request = $client->call('User.login', $params );
// Create the Bug
$bugParams = new Zend_XmlRpc_Value_Struct(
array( 'product' => 'MyApp',
'component' => 'Main',
'summary' => 'Bug Sumary',
'version' => '1.0',
'description' => 'This is the description'
)
);
$result = $client->call( 'Bug.create', $bugParams );
// Logout
$result = $client->call( 'User.logout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment