【VC++开源代码栏目提醒】:网学会员鉴于大家对VC++开源代码十分关注,论文会员在此为大家搜集整理了“mantis使用配置文档(中文图表) - 毕业设计”一文,供大家参考学习
Mantis使用配置文档 V0.3 2012-5-23 高广林 Part1 简介 MantisBT全称MantisBugTracker我们可以见名知意。
作为一套使用PHP编写的
开源BUG跟踪系统mantis具有我们在开发测试中所需要的全部功能使用B/S操作的方式需要我们作出如下部署的支持 1、 Web服务器Apache版本2.2此处及下面涉及的所有使用都是笔者文起日最新版本并且是笔者认为最优的配置方式至于其他配置方式请网上查阅。
2、 PHP支持php-5.4.3-Win32-
VC9-x86 3、 数据库MySQL Server 5.5 4、 PHP邮件支持PHPMailer_5.2.1 以上是搭建mantis缺陷管理系统的依赖下面将依次介绍使用上述工具进行搭建的过程。
Part2 下载并安装环境 一、下载 1、 mantishttp://www.mantisbt.org/download.phpzip文件 2、 apachehttp://httpd.apache.org/download.cgi 安装包 3、 phphttp://windows.php.net/download/ zip文件 4、 phpmailer: http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list zip文件 5、 MySQLhttp://www.mysql.com/downloads/mysql/ 安装包 二、安装 1、将已经下载的“安装文件”运行并完成安装。
备注这里我把MySQL安装到默认的路径将Apache安装到“D:mantisApache2.2”。
2、将已经下载的“zip文件”解压出来。
备注这里我把mantis放在“D:mantismantisbt-1.2.10”php放在“D:mantisphp-5.4.3-Win32-
VC9-x86”phpmailer放在“D:mantisPHPMailer_5.2.1”。
3、添加系统环境变量如下图所示 Path: D:mantisphp-5.4.3-Win32-
VC9-x86D:mantisphp-5.4.3-Win32-
VC9-x86ext 4、添加apache的php支持 1打开D:mantisApache2.2confhttpd.conf文件 2找到“DirectoryIndex”在后添加index.php如下图所示。
3找到“LoadModule vhost_alias_module modules/mod_vhost_alias.so”在其下添 加LoadModule php5_module D:/mantis/php-5.4.3-Win32-
VC9-x86/php5apache2_2.dll再起一行添加PHPIniDir quotD:/mantis/php-5.4.3-Win32-
VC9-x86quot 4找到“AddType application/x-gzip .gz .tgz”在其下添加 AddType application/x-httpd-php .php 再起一行添加 AddType application/x-httpd-php .html 5在文件最后添加 Alias /mantis quotD:/mantis/mantisbt-1.2.10/quot ltDirectory quotD:/mantis/mantisbt-1.2.10/quotgt Options Indexes AllowOverride None Order allowdeny Allow from all lt/Directorygt 如下图所示说明此处的路径及全文的路径都是相对于安装路径。
5、添加mantis的邮件支持 1找到文件 D:mantismantisbt-1.2.10config_inc.php 2添加内容注邮箱地址请输入自己的正确地址如下图所示 g_smtp_host smtp.sina.com.cn g_smtp_username gaoguanglin g_smtp_password 123456 g_use_phpMailer ON g_phpMailer_path D:/mantis/PHPMailer_5.2.1 g_phpMailer_method 2 g_return_path_email gaoguanglinairmedia.net.cn 6、配置PHP 1找到文件D:mantisphp-5.4.3-Win32-
VC9-x86php.ini 2找到include_path改为include_path quot.D:mantisphp-5.4.3-Win32-
VC9-x86quot 并 去 掉前面的“引号”。
3找到extension_dir改为 extension_dir quotD:mantisphp-5.4.3-Win32-
VC9-x86extquot并去掉前面的引号如下图所示。
4找到date.timezone 设置为date.timezone PRC如下图所示 6、 找到 D:mantisApache2.2confmime.types文件在其中最后加入 application/x-httpd-php php application/x-httpd-php-source phps Part3生成数据库并查看运行结果 1、 保存所有上述配置后运行或重启apache在浏览器中输入 http://localhost/mantis/admin/install.php 输入数据库“用户名”“密码”执行 2、 登录默认管理员用户名administrator密码root 3、 打开“My Account”——gt“Preferences”设置语言为“” 4、 保存设置查看功能如下图所示。
Part4 添加报表显示功能 1、 下载jpgraph-3.0.7.tar.gz 下载地址http://jpgraph.net/download/ 2、 将下载的文件解压缩到jpgraph文件夹此时该文件夹中包含src、docportal文件夹等如下图所示。
3、 复制上一步的jpgraph文件夹到路径“mantisbt_home/library”下面。
4、 在文件“mantisbt_home/config_inc.php”中添加如下
代码 g_graph_font simsun g_use_jpgraph ON 5、 找到文件“php_home/php.ini”找到其中的extensionphp_gd2.dll去掉前面的分号保存文件。
6、找到文件“mantisbt_home/config_defaults_inc.php”找到 g_default_language 并设置为 g_default_language chinese_simplified 6、 找到“mantisbt_home/library/jpgraph/jpgraph_ttf_inc.php”找到 elseif aFF FF_SIMSUN // Do Chinese conversion 设置为 elseif aFF FF_SIMSUN // Do Chinese conversion return aTxt 7、 以管理员身份登录mantis系统点击“管理”-〉“插件管理”-〉安装插件。
8、 找到文件“mantisbt_home/plugins/MantisGraph/pages/config.php”做出如下修改 t_current_font_selected array simsun gt false //增加这一行 arial gt false //-------------------------------------- Sans-serif:ltbr /gt ltlabelgtltinput typequotradioquot namequotfontquot valuequotsimsunquotltphp echo print_font_checked simsun gt/gtSimsunlt/labelgtltbr /gt //增加这一行 ltlabelgtltinput typequotradioquot namequotfontquot valuequotarialquotltphp echo print_font_checked arial gt/gtAriallt/labelgtltbr /gt 9、 找到文件“mantisbt_homepluginsMantisGraphpagesconfig_edit.php”作出如下修改 t_font_map array simsun gt FF_SIMSUN //增加这一行 arial gt FF_ARIAL 10、 回到“mantis系统操作界面”点击“管理”-〉“插件管理”-〉“Mantis图表 1.0”作出如下图设置 点击“更改配置”。
11、 文件“mantisbt_home/plugins/MantisGraph/core/graph_api.php”中增加对图形标题等设置字体的
代码: 片段一 graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gtSetFontFF_SIMSUNFS_NORMAL // 片段二 graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtlegend-gtSetFontFF_SIMSUNFS_NORMAL 详细为 第一处函数graph_bar中在“graph-gtyaxis-gtSetFont t_graph_font ”和“p1 new BarPlot array_values p_metrics ”之间加入第一段
代码。
第二处函数graph_group中在“graph-gtyscale-gtSetGrace10”和“adds on the same graph”之间依次加入上面两段
代码。
第四处函数graph_pie中在“graph-gtlegend-gtSetFont t_graph_font ”和“p1 new PiePlot3d array_values p_metrics ”之间加入第二段
代码。
第五处函数graph_cumulative_bydate中在“graph-gtxaxis-gtSetFont t_graph_font ”和“p1 new LinePlotreported_plot plot_date”之间依次加入上面两段
代码。
第六处函数error_text方法中在“graph-gttitle-gtSetFont t_graph_font FS_BOLD ”和“graph-gtAddTexttxt”之间加入第二段
代码和txt-gtSetFontFF_SIMSUNFS_NORMAL。
可用附件覆盖原文件。
附件graph_api.php ltphp MantisBT - a php based bugtracking system MantisBT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License or at your option any later version. MantisBT is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with MantisBT. If not see lthttp://www.gnu.org/licenses/gt. / package CoreAPI subpackage GraphAPI copyright Copyright C 2000 - 2002 Kenzaburo Ito - kenito300baud.org copyright Copyright C 2002 - 2012 MantisBT Team - mantisbt-devlists.sourceforge.net link http://www.mantisbt.org / if OFF plugin_config_get eczlibrary t_font_path get_font_path if t_font_path ampamp definedTTF_DIR define TTF_DIR t_font_path t_jpgraph_path plugin_config_get jpgraph_path if t_jpgraph_path set_include_pathget_include_path . PATH_SEPARATOR . t_jpgraph_path ip get_include_path require_once jpgraph.php require_once jpgraph_line.php require_once jpgraph_bar.php require_once jpgraph_pie.php require_once jpgraph_pie3d.php require_once jpgraph_canvas.php else require_once jpgraph/jpgraph.php require_once jpgraph/jpgraph_line.php require_once jpgraph/jpgraph_bar.php require_once jpgraph/jpgraph_pie.php require_once jpgraph/jpgraph_pie3d.php require_once jpgraph/jpgraph_canvas.php else require_once ezc/Base/src/base.php function graph_get_font t_font plugin_config_get font arial if plugin_config_get eczlibrary ON t_font_map array arial gt arial.ttf verdana gt verdana.ttf trebuchet gt trebuc.ttf verasans gt Vera.ttf times gt times.ttf georgia gt georgia.ttf veraserif gt VeraSe.ttf courier gt cour.ttf veramono gt VeraMono.ttf if isset t_font_mapt_font t_font t_font_mapt_font else t_font arial.ttf t_font_path get_font_path if emptyt_font_path error_textUnable to read/find font Unable to read/find font t_font_file t_font_path . t_font if file_existst_font_file false is_readablet_font_file false error_textUnable to read/find font Unable to read/find font return t_font_file else t_font_map array simsun gt FF_SIMSUN arial gt FF_ARIAL verdana gt FF_VERDANA trebuchet gt FF_TREBUCHE verasans gt FF_VERA times gt FF_TIMES georgia gt FF_GEORGIA veraserif gt FF_VERASERIF courier gt FF_COURIER veramono gt FF_VERAMONO if isset t_font_mapt_font return t_font_mapt_font else return FF_FONT1 Graph API -------------------- graphing routines -------------------- function graph_bar p_metrics p_title p_graph_width 350 p_graph_height 400 t_graph_font graph_get_font error_check is_array p_metrics array_sum p_metrics : 0 p_title if plugin_config_get eczlibrary ON graph new ezcGraphBarChart graph-gttitle p_title graph-gtbackground-gtcolor FFFFFF graph-gtoptions-gtfont t_graph_font graph-gtoptions-gtfont-gtmaxFontSize 12 graph-gtlegend false graph-gtdata0 new ezcGraphArrayDataSet p_metrics graph-gtdata0-gtcolor FFFF00 graph-gtxAxis-gtaxisLabelRenderer new ezcGraphAxisRotatedLabelRenderer graph-gtxAxis-gtaxisLabelRenderer-gtangle 45 New Added graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtdriver new ezcGraphGdDriver //graph-gtdriver-gtoptions-gtsupersampling 1 graph-gtdriver-gtoptions-gtjpegQuality 100 graph-gtdriver-gtoptions-gtimageFormat IMG_JPEG graph-gtrenderer-gtoptions-gtsyncAxisFonts false graph-gtrenderToOutput p_graph_width p_graph_height else graph new Graph p_graph_width p_graph_height graph-gtimg-gtSetMargin 40 40 40 170 if ON plugin_config_get jpgraph_antialias graph-gtimg-gtSetAntiAliasing graph-gtSetScale textlin graph-gtSetMarginColor white graph-gtSetFrame false graph-gttitle-gtSet p_title graph-gttitle-gtSetFont t_graph_font FS_BOLD graph-gtxaxis-gtSetTickLabels array_keys p_metrics if FF_FONT2 lt t_graph_font graph-gtxaxis-gtSetLabelAngle 60 else graph-gtxaxis-gtSetLabelAngle 90 cant rotate non truetype fonts graph-gtxaxis-gtSetFont t_graph_font graph-gtlegend-gtSetFont t_graph_font graph-gtyaxis-gtscale-gtticks-gtSetDirection -1 graph-gtyaxis-gtSetFont t_graph_font New Added graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gtSetFontFF_SIMSUNFS_NORMAL p1 new BarPlot array_values p_metrics p1-gtSetFillColor yellow p1-gtSetWidth 0.8 graph-gtAdd p1 if helper_show_queries graph-gtsubtitle-gtSet db_count_queries . queries . db_time_queries . sec graph-gtsubtitle-gtSetFont t_graph_font FS_NORMAL 8 graph-gtStroke Function which displays the charts using the absolute values according to the status opened/closed/resolved function graph_group p_metrics p_title p_graph_width 350 p_graph_height 400 p_baseline 100 p_metrics is an array of three arrays p_metricsopen array enum gt value ... p_metricsresolved p_metricsclosed t_graph_font graph_get_font count up array portions that are set t_count 0 foreach array open resolved closed as t_label if isset p_metricst_label ampamp is_array p_metricst_label t_count array_sum p_metricst_label error_check t_count p_title calculate totals total graph_total_metrics p_metrics if plugin_config_get eczlibrary ON graph new ezcGraphBarChart graph-gttitle p_title graph-gtbackground-gtcolor FFFFFF graph-gtoptions-gtfont t_graph_font graph-gtoptions-gtfont-gtmaxFontSize 12 graph-gtlegend false graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL foreach array open resolved closed as t_label graph-gtdatat_label new ezcGraphArrayDataSet p_metricst_label graph-gtdatatotal new ezcGraphArrayDataSet total //graph-gtdatatotal-gtdisplayType ezcGraph::LINE //graph-gtdatatotal-gtbarMargin -20 graph-gtoptions-gtfillLines 210 graph-gtxAxis-gtaxisLabelRenderer new ezcGraphAxisRotatedLabelRenderer graph-gtxAxis-gtaxisLabelRenderer-gtangle 45 graph-gtdriver new ezcGraphGdDriver //graph-gtdriver-gtoptions-gtsupersampling 1 graph-gtdriver-gtoptions-gtjpegQuality 100 graph-gtdriver-gtoptions-gtimageFormat IMG_JPEG graph-gtrenderer-gtoptions-gtsyncAxisFonts false graph-gtrenderToOutput p_graph_width p_graph_height else defines margin according to height graph new Graph p_graph_width p_graph_height graph-gtimg-gtSetMargin 45 35 35 p_baseline if ON plugin_config_get jpgraph_antialias graph-gtimg-gtSetAntiAliasing graph-gtSetScale textlin graph-gtSetMarginColor white graph-gtSetFrame false graph-gttitle-gtSetFont t_graph_font FS_BOLD graph-gttitle-gtSet p_title graph-gtxaxis-gtSetTickLabels array_keys p_metricsopen if FF_FONT2 lt t_graph_font graph-gtxaxis-gtSetLabelAngle 60 else graph-gtxaxis-gtSetLabelAngle 90 cant rotate non truetype fonts graph-gtxaxis-gtSetFont t_graph_font graph-gtlegend-gtPos 0.05 0.08 graph-gtlegend-gtSetFont t_graph_font graph-gtyaxis-gtscale-gtticks-gtSetDirection -1 graph-gtyaxis-gtSetFont t_graph_font graph-gtyscale-gtSetGrace 10 New Added graph-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gttitle-gtSetFontFF_SIMSUNFS_NORMAL graph-gtxaxis-gtSetFontFF_SIMSUNFS_NORMAL graph-gtyaxis-gtSetFontFF_SIMSUNFS_NORMAL graph-gtlegend-gtSetFontFF_SIMSUNFS_NORMAL adds on the same graph tot new BarPlot array_values total tot-gtSetFillColor lightblue tot-gtSetWidth 0.7 tot-gtSetLegend plugin_lang_get legend_total graph-gtAdd tot p1 new BarPlot array_values p_metricsopen p1-gtSetFillColor yellow p1-gtSetWidth 1 p1-gtSetLegend plugin_lang_get legend_opened p2 new BarPlot array_values p_metricsclosed p2-gtSetFillColor blue p2-gtSetWidth 1 p2-gtSetLegend plugin_lang_get legend_closed p3 new BarPlot array_values p_metricsresolved p3-gtSetFillColor red p3-gtSetWidth 1 p3-gtSetLegend plugin_lang_get legend_resolved gbplot new GroupBarPlot array p1 p3 p2 graph-gtAdd gbplot if helper_show_queries graph-gtsubtitle-gtSet db_count_queries . queries . db_time_queries . sec graph-gtsubtitle-gtSetFont t_graph_font FS_NORMAL 8 graph-gtStroke -------------------- Funct.
上一篇:
基于STM32的USB程序开发笔记
下一篇:
如何当一个轻松的班主任