?>
2) 把trac的项目与testlink的项目对应
$g_interface_bugs_project_name_mapping = array(
'ewayhrp' => 'test',
'<YourTLTestProjectName2>' => '<YourTracProject2>',
);
[components] tracrpc.* = enabled
授权:把TICKET_VIEW(如果已经存在则不需要授,否则出错)和XML_RPC授给anonymous
命令提示符进入<PythonDir>/scripts目录下,输入
trac-admin /home/mypro/项目 permission add anonymous XML_RPC
trac-admin /home/mypro/项目 permission add anonymous TICKET_VIEW
打开trac。会发现
打开开,可以发现很多api的方法。至于能不能用,先不管。
modified /../testlink/cfg/trac.cfg.php, added: define('BUG_TRACK_XMLRPC_HOST', 'http://username:password@YourIpAddress'); |
modified /../testlink/lib/bugtracking/int_trac.php: $this->xmlrpcClient = new IXR_Client(BUG_TRACK_XMLRPC_HOST.$tracProjectName.'/login/xmlrpc'); |
modified /../testlink/third_party/xml-rpc/class-IXR.php |
function query() { $args = func_get_args(); $method = array_shift($args); $request = new IXR_Request($method, $args); $length = $request->getLength(); $xml = $request->getXml(); $r = "\r\n"; $credentials = ""; if ($this->user != "") { $credentials = base64_encode($this->user . ":" . $this->pass); } $request = "POST {$this->path} HTTP/1.0$r"; $request .= "Host: {$this->server}$r"; if ($credentials != "") {$request .= "Authorization: Basic {$credentials}$r";} |
function IXR_Client( $server, $path = false, $port = 80, $timeout = false) { if (!$path) { // Assume we have been given a URL instead$bits = parse_url($server); $this->server = $bits['host']; $this->port = isset($bits['port']) ? $bits['port'] : 80; $this->user = isset($bits['user']) ? $bits['user'] : ''; $this->pass = isset($bits['pass']) ? $bits['pass'] : ''; |
第一种:修改config.inc.php中的[smtp],配置为默认本地发送,用hotmail用户做接收,调试成功!
// ----------------------------------------------------------------------------
/** [SMTP] */
// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
//
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_tl_admin_email = 'tl_admin@127.0.0.1';#按此配置即可
$g_from_email = 'testlink_system@127.0.0.1';#按此配置即可
$g_return_path_email = 'no_replay@127.0.0.1';#按此配置即可
//
# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;
//
# Taken from mantis for phpmailer config
//define ("SMTP_SEND",2);
//$g_phpMailer_method = SMTP_SEND;
//
// SMTP Configuration
$g_smtp_host = 'localhost'; # SMTP server
//
// Configure only if SMTP server requires
$g_smtp_username = ''; # user
$g_smtp_password = ''; # password
// ----------------------------------------------------------------------------
第二种:修改config.inc.php中的[smtp],配置为公司邮箱发送,用我公司邮箱调试成功!
// ----------------------------------------------------------------------------
/** [SMTP] */
// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
//
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host = 'smtp.corp.com'; # SMTP 服务必须配置,可配置你公司发送邮件服务器地址
# Configure using custom_config.inc.php
$g_tl_admin_email = 'test@corp.com'; #问题错误通知,配置你公司的邮箱
$g_from_email = 'test@corp.com'; # 收到邮件看到的发送地址
$g_return_path_email = 'test@corp.com';#如果收到邮件的人进行回复的邮件地址
# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;
# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;#使用SMTP协议进行发送
// Configure only if SMTP server requires authentication
$g_smtp_username = 'test@corp.com'; # smtp发送的用户名
$g_smtp_password = 'test'; # 发送用户的密码
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /home/mypro
PythonOption TracUriRoot /trac/
PythonOption PYTHON_EGG_CACHE /tmp/egg-cache
AuthType Basic
AuthName "Trac myql uesr user login"
AuthUserFile /home/svn/passwd
# AuthMySQLAuthoritative on
# AuthBasicAuthoritative off
# AuthMySQLHost localhost
# AuthMySQLUser root
# AuthMySQLPassword *****
# AuthMySQLDB bugfree2
# AuthMySQLUserTable bf_TestUser
# AuthMySQLNameField UserName
# AuthMySQLPasswordField UserPassword
# AuthMySQLPwEncryption md5
Require valid-user
</Location>