setDebug (1); } else { $cli->setDebug (0); } //send $resp = $cli->send($msg); if (!$resp) { return false; } // error handling if (!$resp->faultCode()) { $val = $resp->value(); $data = XML_RPC_decode($val); return $data; } else { return false; } } function xmlrpc_login($username, $password, $debug) { $args['method'] = 'internal_user.login'; $args['args'] = array($username, $password); $args['type'] = 'internal'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_login_key($user_key, $application_key, $debug) { $args['method'] = 'user.login_key'; $args['args'] = array($user_key, $application_key); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_user_my_name($session, $debug) { $args['method'] = 'user.my_name'; $args['args'] = array($session); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_project_list($session, $show_hidden, $debug) { $args['method'] = 'project.list'; $args['args'] = array($session, $show_hidden); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_project_list_partial($session, $show_hidden, $start_index, $count, $debug) { $args['method'] = 'project.list_partial'; $args['args'] = array( $session, $show_hidden, $start_index, $count ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } // workitem.list_project(session: String, project_id: int, limit: int, unread_only: boolean): array[workitem_struct] function xmlrpc_workitem_list_project($session, $project_id, $limit, $unread_only, $debug) { $args['method'] = 'workitem.list_project'; $args['args'] = array( $session, $project_id, $limit, $unread_only ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_search($session, $project_id, $search, $debug) { $args['method'] = 'issue.search'; $args['args'] = array( $session, $project_id, $search ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_list_tags($session, $project_id, $debug) { $args['method'] = 'issue.list_tags'; $args['args'] = array($session, $project_id); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_list($session, $project_id, $debug) { $args['method'] = 'issue.list'; $args['args'] = array($session, $project_id); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_list_changed($session, $project_id, $date, $debug) { $args['method'] = 'issue.list_changed'; $args['args']=array( $session, $project_id, $date ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_add($session, $project_id, $title, $description, $tags, $is_private, $debug) { $args['method'] = 'issue.add'; $args['args']=array( $session, $project_id, $title, $description, $tags, $is_private ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } function xmlrpc_issue_retrieve($session, $project_issue_id, $project_id, $debug) { $args['method'] = 'issue.retrieve'; $args['args']=array( $session, $project_issue_id, $project_id ); $args['type'] = 'external'; $args['debug'] = $debug; return xmlrpc_call($args); } $session = xmlrpc_login("insert_name","insert_pw",false); // $session=xmlrpc_login_key("insert user key","insert app key",false); // print_r(xmlrpc_user_my_name($session, true)); // print_r(xmlrpc_project_list($session, false, true)); // $search = array('title'=>'some title', 'description'=>'some description', 'status'=>'open'); // print_r(xmlrpc_issue_search($session, 1, $search, true)); // print_r(xmlrpc_issue_list_tags($session, 1, true)); ?>