mantis

  • Mantis与SVN(subversion)的集成

    2007-3-24

    Mantis与SVN(subversion)的集成

     集成SVN源码管理和Mantis缺陷跟踪

    要集成Mantis和SVN,需要几个工具:

    SVN客户端,有个windows下的很不错的工具,TortoiseSVN,完全集成在explorer里,下载地址: http://tortoisesvn.net/ 

    SVN服务端,这个应该都有吧。

    Mantis缺陷跟踪系统,用php开发。轻量级的缺陷跟踪系统。 http://www.mantisbt.org/

    首先先在TortoiseSVN里设置一下项目的属性,右键点击目录,属性,在subversion一栏里,加入这几个属性

    bugtraq:label = issue
    bugtraq:url = http://<mantisserver>/mantis/view.php?id=%BUGID%
    bugtraq:message = issue %BUGID%
    bugtraq:warnifnoissue = true

    到对应的SVN版本库里,找到hooks目录,建立一个post-commit.bat文件,将以下内容拷入:

    REM Post-commit hook for MantisBT integration
    SET REPOS=%1
    SET REV=%2
    SET DETAILS_FILE=E:/svnrepo/log/svnfile_%REV%
    SET LOG_FILE=E:/svnrepo/log/svnfile_%REV%_Log
    set APR_ICONV_PATH=F:/software/svn-win32-1.4.2/iconv
    set path=%path%;e:/software/php;F:/software/svn-win32-1.4.2/bin;


    echo ****** Source code change ******>>%DETAILS_FILE%
    svnlook log -r %REV% %REPOS%>>%DETAILS_FILE%
    echo SVN Revision:%REV%>>%DETAILS_FILE%
    svnlook diff -r %REV% %REPOS%>>%DETAILS_FILE%

    php.exe E:/www/mantis/core/checkin.php <%DETAILS_FILE% >%LOG_FILE%
    DEL %DETAILS_FILE%
    DEL %LOG_FILE%

    最后,修改mantis安装目录下的config_inc.php,加入以下内容(mantis系统里要有SVN用户):

    $g_source_control_notes_view_status = VS_PUBLIC;
     $g_source_control_account = 'SVN';
     $g_source_control_set_status_to = OFF;
     $g_source_control_regexp = "//bissue [#]{0,1}(/d+)/b/i";

    完成这些步骤后,就可以在SVN提交新版本时,同时发布内容到对应的缺陷跟踪系统了。

    比如,修改了一个源文件,svn commit时,在右上的issue栏目里输入要提交到的具体的 issue/bug  编号,然后在下面的message框内输入具体的描述,svn的hook就会自动往mantis里对应的条目里写入你提交时输入的这些内容。


  • TestLink与Mantis的集成

    2007-3-24

    TestLink与Mantis的集成

    1、中文显示;

    2、BTS问题;

    3、数据库连接;

    4、乱码处理;

    出差一个月,原来要记录的内容又忘了?

    留个脚印先!以后再补。----2007-5-15

Mantis相关配置

2007-3-20

以下的配置基于mantis1.1


1.中文编码集

TO:解决浏览器访问Mantis时中文字体乱码问题

修改Mantis中的默认配置文件config_defaults_inc.php,找到如下内容,对照修改.

如果把以下内容拷到config_inc.php中也可以.

配置文件加载顺序:先加载config_defaults_inc.php,后加载config_inc.php。

config_inc.php中的值会覆盖config_defaults_inc.php.

  ################################
 # Mantis Language Settings
 ################################

 # --- language settings -----------
 # If the language is set to 'auto', the actual
 # language is determined by the user agent (web browser)
 # language preference.
 $g_default_language  = 'chinese_simplified_gb2312';

 # list the choices that the users are allowed to choose
 $g_language_choices_arr = array(
  'auto',
  'bulgarian',
  'catalan',
  'chinese_simplified_gb2312',
  'chinese_traditional',
  'croatian',
  'czech',
  'danish',
  'dutch',
  'english',
  'estonian',
  'finnish',
  'french',
  'german',
  'hebrew',
  'hungarian',
  'icelandic',
  'italian',
  'japanese',
  'korean',
  'latvian',
  'lithuanian',
  'norwegian',
  'polish',
  'portuguese_brazil',
  'portuguese_standard',
  'romanian',
  'russian',
  'serbian',
  'slovak',
  'slovene',
  'spanish',
  'swedish',
  'turkish',
  'ukrainian'
 );

 # Browser language mapping for 'auto' language selection
 $g_language_auto_map = array(
  'bg' => 'bulgarian',
  'ca' => 'catalan',
  'zh-cn, zh-sg, zh' => 'chinese_simplified_gb2312',
  'zh-hk, zh-tw' => 'chinese_traditional',
  'cs' => 'czech',
  'da' => 'danish',
  'nl-be, nl' => 'dutch',
  'en-us, en-gb, en-au, en' => 'english',
  'et' => 'estonian',
  'fi' => 'finnish',
  'fr-ca, fr-be, fr-ch, fr' => 'french',
  'de-de, de-at, de-ch, de' => 'german',
  'he' => 'hebrew',
  'hu' => 'hungarian',
  'hr' => 'croatian',
  'is' => 'icelandic',
  'it-ch, it' => 'italian',
  'ja' => 'japanese',
  'ko' => 'korean',
  'lt' => 'lithuanian',
  'lv' => 'latvian',
  'no' => 'norwegian',
  'pl' => 'polish',
  'pt-br' => 'portugese_brazil',
  'pt' => 'portugese_standard',
  'ro-mo, ro' => 'romanian',
  'ru-mo, ru-ru, ru-ua, ru' => 'russian',
  'sr' => 'serbian',
  'sk' => 'slovak',
  'sl' => 'slovene',
  'es-mx, es-co, es-ar, es-cl, es-pr, es' => 'spanish',
  'sv-fi, sv' => 'swedish',
  'tr' => 'turkish',
  'uk' => 'ukrainian'
 );

 # Fallback for automatic language selection
 $g_fallback_language = 'english';


2.邮件配置

TO:解决邮件发送问题

以下内容可以在config_defaults_inc.php中找到。

建议把该内容拷到config_inc.php中.

 #############################
 # Mantis Email Settings
 #############################

 # --- email variables -------------
 $g_administrator_email =
'testsrv@xxx.com';
 $g_webmaster_email  =
'testsrv@xxx.com';

 # the 'From: ' field in emails
 $g_from_email   =
'testsrv@xxx.com';

 # the return address for bounced mail
 $g_return_path_email =
'testsrv@xxx.com';

 # allow email notification
 #  note that if this is disabled, sign-up and password reset messages will
 #  not be sent.
 $g_enable_email_notification = ON;
 # select the method to mail by:
 # 0 - mail()
 # 1 - sendmail
 # 2 - SMTP
 $g_phpMailer_method  = 2;

 # This option allows you to use a remote SMTP host.  Must use the phpMailer scrīpt
 # Name of smtp host, needed for phpMailer, taken from php.ini
 $g_smtp_host   = 'mail.xxx.com';

 # These options allow you to use SMTP Authentication when you use a remote
 # SMTP host with phpMailer.  If smtp_username is not '' then the username
 # and password will be used when logging in to the SMTP server.
 $g_smtp_username = 'testsrv';
 $g_smtp_password = 'testsrv';

邮件系统的配置建议用smtp方式。一般公司都有自己的邮件服务器,让管理员给你开一个mantis的专用信箱。

另:本人配置mantis邮件服务时,也出现过邮件发送成功但收不到的情况,后来让公司管理员协助,从邮件服务器的后台日志查到。原来是把testsrv@xxx.com写成testesrv@xxx.com

 呵呵,要细心一点哦!

 

3.图形报表

TO:解决图形报表中文字体输出问题.

在mantis1.1中,现在稍微简单一些,只要改个字体就可以。

打开core/graph_api.php文件,找到如下内容,并添加一行:

 function graph_get_font() {
  $t_font_map = array(
   'simsun' => FF_SIMSUN,
   'arial' => FF_ARIAL,
   'verdana' => FF_VERDANA,
   'courier' => FF_COURIER,
   'comic' => FF_COMIC,
   'times' => FF_TIMES,
   'georgia' => FF_GEORGIA,
   'trebuche' => FF_TREBUCHE,
   'vera' => FF_VERA,
   'veramono' => FF_VERAMONO,
   'veraserif' => FF_VERASERIF );

  $t_font = config_get( 'graph_font', '');
  if ( isset( $t_font_map[$t_font] ) ) {
   return $t_font_map[$t_font];
  } else {
   return FF_FONT1;
  }

另外注意config_inc.php或config_defaults_inc.php中应该有以下配置内容:

############################
 # Mantis JPGRAPH Addon
 ############################

 # --- jpgraph settings --- #
 # Initial Version from Duncan Lisset
 #
 # To use the Jpgraph addon you need the JPGRAPH package from
 #
http://www.aditus.nu/jpgraph/index.php
 # You can place the package whereever you want, but you have
 # to set the var in jpgraph.php eg.
 # (DEFINE('DIR_BASE','/www/mantisbt/jpgraph/');)

 $g_use_jpgraph   = ON;
 $g_jpgraph_path   = 'D:/mantis-1.1.0a2/core/jpgraph/src' . DIRECTORY_SEPARATOR . '' . DIRECTORY_SEPARATOR;   # dont forget the ending slash!

#注意:这里需要指定src/jpgraph.php的路径.页面出错时会有提示的.

 # what truetype font will the graphs use. Allowed values are 'arial', 'verdana', 'courier', 'book', 'comic', 'times',
 #  'georgia', 'trebuche', 'vera', 'veramono', or 'veraserif'. Refer to the jpgraph manual for details.
 # NOTE: these fonts need to be installed in the TTF_DIR as specified to jpgraph
 $g_graph_font = 'simsun';

 # what width is used to scale the graphs.
 $g_graph_window_width = 800;
 # bar graph aspect ration (height / width)
 $g_graph_bar_aspect = 0.9;

 # how many graphs to put in each row in the advanced summary page
 $g_graph_summary_graphs_per_row = 2;

 $g_system_font_folder = 'c:/winnt/fonts/';

 $g_font_per_captcha = 'simsun.ttf';

4.时区设置

TO:解决mantis页面时间显示问题,默认用的是GMT格林威治时间.与中国时间相差8小时.

在config_inc.php或config_defaults_inc.php中添加以下内容:

 #时区设置

putenv("TZ=Asia/Shanghai");

另外网上也有人提到在php.ini中进行如下设置。(如果putenv函数不起作用的话,可以试下

[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/shanghai


5.数据库(Mysql)

版本:MySQL 5.0系列

很多人用phpMyAdmin对mysql进行数据管理。

建议大家用MySQL-Front,我用的是3.2版。

图形化界面操作挺方便。

mantis中的数据源连接配置还是比较简单的,在config_inc.php中设置:

 ################################
 # Mantis Database Settings
 ################################

 # --- database variables ---------

 # set these values to match your setup

 # hostname should be either a hostname or connection string to supply to adodb.
 # For example, if you would like to connect to a mysql server on the local machine,
 # set hostname to 'localhost', and db_type to 'mysql'.
 # If you need to supply a port to connect to, set hostname as 'localhost:3306'.
 $g_hostname    = 'localhost';
 $g_db_username   = 'mantis';
 $g_db_password   = 'mantis';
 $g_database_name  = 'mantis';

#这里数据库用户名,密码,和数据库名称,全都是用mantis.

#要在myssql中新建一个数据库用户mantis,注意给它足够的权限。

 # Supported types: mysql for MySQL, mysqli for MySQL, pgsql for PostgreSQL, mssql for MS SQL Server, oci8 for Oracle.这里支持的数据库类型还真不少。
 $g_db_type    = 'mysql';


6.web服务器(Apache Or IIS)

mantis目前常用的服务就是这两种,这里推荐用Apache.

Apache现在版本是2.2系列。配置主要是一个应用服务目录的配置,

打开apache/conf/httpd.conf,在文件的最后添加以下内容:

Alias /mantis "D:/mantis-1.1.0a2/"
#这是服务访问的虚拟路径设置

<Directory "D:/mantis-1.1.0a2/">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Apache端口修改:

#Listen 12.34.56.78:80
Listen 80

默认应用目录修改:

DocumentRoot "D:/mantis-1.1.0a2"


 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值