Created
January 31, 2012 09:17
-
-
Save sbarrat/1709587 to your computer and use it in GitHub Desktop.
XMLRPC_Client Bugzilla with Zend Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' => '[email protected]', | |
'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