bugfree在win7(64位)平台的搭建
BugFree是借鉴微软的研发流程和Bug管理理念,使用PHP+MySQL独立写出的一个Bug管理 系统。简单实用、免费并且开放源代码(遵循GNU GPL)。
Bugfree的安装:引用文档http://www.cnblogs.com/emilyzhang68/archive/2011/08/24/2152433.html ,下面是对该文档的补充说明:
以管理员身份安装xampp,安装到尾声的时候会询问是否设置为服务(方便每次开机自动运行),选择Yes。
接着,xampp的设置脚本会启动,完成后提示是否成功。最后提示是否现在启动xampp control panel。点击Yes,出现下图:
我使用的是xampp-win32-1.8.2-3-VC9-installer,如果apache为启动,如果是80端口被占用,直接改端口,鼠标点击上面的config按钮,打开相应的conf文件修改其他端口,然后重启服务。
如果已经安装过mysql、php等,请不要勾选,否则会出现问题。 Openssl也不是必须安装的,如果使用https,必须要安装openssl,openssl的64位要自己编译,采用vs的64位命令行工具,首先要下载ActivePerl,可到http://www.activestate.com/ActivePerl,再下载openssl;用vs的64位命令行工具,切换到openssl的目录下,执行下面的命令:perl Configure VC-WIN64A ms\do_win64a nmake -f ms\ntdll.mak,切记要使用vs64位命令行工具。如下图所示:
安装xampp后,将bugfree的安装包解压到xampp的htdocs目录下,完整的目录是 C:\xampp\htdocs\bugfree,将bugfree目录下的Config.inc.Sample.php复制一份,改名为Config.inc,其中,25行以下这几行是关于数据库的设置,如果安装过mysql,在这里设置一下数据库连接的密码、用户名等 /* 3. Define the username and password of the BugFree database. */ $_CFG['DB']['User'] = 'root'; $_CFG['DB']['Password'] = '1234'; $_CFG['DB']['Host'] = 'localhost'; $_CFG['DB']['Database'] = 'bugfree2'; $_CFG['DB']['TablePrefix'] = 'bf_'; $_CFG['DBCharset'] = 'UTF8';
如果安装过mysql,出现上面的mysql数据库未激活,不用理会,但是上面的数据库连接设置参数一定要设置,否则无法安装bugfree。
访问https://localhost/xampp/bugfree,如果报以下错误:Fatal error: Call-time pass-by-reference has been removed in,意思是调用时引用传参已经被移除了,
就是不能通过function(&$a)这种方式传参调用函数. 以前的php代码在升级到5.4版本的php可能会出现这种错误:改正方法,调用时直接传参就行了: foo($var) .这个错误出现的文件名:include下的class目录的XmlParse.classphp,一下是我修改过的php文件。
1 <?php
2 error_reporting( E_ERROR | E_PARSE);
3
4 function & XML_unserialize(& $xml){
5 $xml_parser = new XML();
6 $data = & $xml_parser->parse( $xml);
7 $xml_parser->destruct();
8 return $data;
9 }
10
11 function & XML_serialize(& $data, $level = 0, $prior_key = NULL){
12 if( $level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; }
13 while( list( $key, $value) = each( $data))
14 if(! strpos( $key, ' attr')) # if it's not an attribute
15 # we don't treat attributes by themselves, so for an emptyempty element
16 # that has attributes you still need to set the element to NULL
17
18 if( is_array( $value) and array_key_exists(0, $value)){
19 XML_serialize( $value, $level, $key);
20 } else{
21 $tag = $prior_key ? $prior_key : $key;
22 echo str_repeat("\t", $level),'<', $tag;
23 if( array_key_exists("$key attr", $data)){ # if there's an attribute for this element
24 while( list( $attr_name, $attr_value) = each( $data["$key attr"]))
25 echo ' ', $attr_name,'="', htmlspecialchars( $attr_value),'"';
26 reset( $data["$key attr"]);
27 }
28
29 if( is_null( $value)) echo " />\n";
30 elseif(! is_array( $value)) echo '>', htmlspecialchars( $value),"</$tag>\n";
31 else echo ">\n",XML_serialize( $value, $level+1), str_repeat("\t", $level),"</$tag>\n";
32 }
33 reset( $data);
34 if( $level == 0){ $str = & ob_get_contents(); ob_end_clean(); return $str; }
35 }
36
37 class XML{
38 var $parser; # a reference to the XML parser
39 var $document; # the entire XML structure built up so far
40 var $parent; # a pointer to the current parent - the parent will be an array
41 var $stack; # a stack of the most recent parent at each nesting level
42 var $last_opened_tag; # keeps track of the last tag opened.
43
44 function XML(){
45 $this->parser = & xml_parser_create();
46 xml_parser_set_option( $this->parser, XML_OPTION_CASE_FOLDING, false);
47 xml_set_object( $this->parser, $this);
48 xml_set_element_handler( $this->parser, 'open','close');
49 xml_set_character_data_handler( $this->parser, 'data');
50 }
51 function destruct(){ xml_parser_free( $this->parser); }
52 function & parse(& $data){
53 $this->document = array();
54 $this->stack = array();
55 $this->parent = & $this->document;
56 return xml_parse( $this->parser, $data, true) ? $this->document : NULL;
57 }
58 function open(& $parser, $tag, $attributes){
59 $this->data = ''; # stores temporary cdata
60 $this->last_opened_tag = $tag;
61 if( is_array( $this->parent) and array_key_exists( $tag, $this->parent)){ # if you've seen this tag before
62 if( is_array( $this->parent[ $tag]) and array_key_exists(0, $this->parent[ $tag])){ # if the keys are numeric
63 # this is the third or later instance of $tag we've come across
64 $key = count_numeric_items( $this->parent[ $tag]);
65 } else{
66 # this is the second instance of $tag that we've seen. shift around
67 if( array_key_exists("$tag attr", $this->parent)){
68 $arr = array('0 attr'=>& $this->parent["$tag attr"], & $this->parent[ $tag]);
69 unset( $this->parent["$tag attr"]);
70 } else{
71 $arr = array(& $this->parent[ $tag]);
72 }
73 $this->parent[ $tag] = & $arr;
74 $key = 1;
75 }
76 $this->parent = & $this->parent[ $tag];
77 } else{
78 $key = $tag;
79 }
80 if( $attributes) $this->parent["$key attr"] = $attributes;
81 $this->parent = & $this->parent[ $key];
82 $this->stack[] = & $this->parent;
83 }
84 function data(& $parser, $data){
85 if( $this->last_opened_tag != NULL) # you don't need to store whitespace in between tags
86 $this->data .= $data;
87 }
88 function close(& $parser, $tag){
89 if( $this->last_opened_tag == $tag){
90 $this->parent = $this->data;
91 $this->last_opened_tag = NULL;
92 }
93 array_pop( $this->stack);
94 if( $this->stack) $this->parent = & $this->stack[ count( $this->stack)-1];
95 }
96 }
97 function count_numeric_items(& $array){
98 return is_array( $array) ? count( array_filter( array_keys( $array), 'is_numeric')) : 0;
99 }
100
101 ?>
102
错误:php Only variables should be passed by reference in,参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值 原来代码:$ProjectInfo = array_pop(testGetProjectList("ProjectID = '{$ProjectID}'")); 改正后的------ FuncModel.inc.php 46行 $Result = testGetProjectList("ProjectID = '{$ProjectID}'"); $ProjectInfo = array_pop($Result);
2 error_reporting( E_ERROR | E_PARSE);
3
4 function & XML_unserialize(& $xml){
5 $xml_parser = new XML();
6 $data = & $xml_parser->parse( $xml);
7 $xml_parser->destruct();
8 return $data;
9 }
10
11 function & XML_serialize(& $data, $level = 0, $prior_key = NULL){
12 if( $level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; }
13 while( list( $key, $value) = each( $data))
14 if(! strpos( $key, ' attr')) # if it's not an attribute
15 # we don't treat attributes by themselves, so for an emptyempty element
16 # that has attributes you still need to set the element to NULL
17
18 if( is_array( $value) and array_key_exists(0, $value)){
19 XML_serialize( $value, $level, $key);
20 } else{
21 $tag = $prior_key ? $prior_key : $key;
22 echo str_repeat("\t", $level),'<', $tag;
23 if( array_key_exists("$key attr", $data)){ # if there's an attribute for this element
24 while( list( $attr_name, $attr_value) = each( $data["$key attr"]))
25 echo ' ', $attr_name,'="', htmlspecialchars( $attr_value),'"';
26 reset( $data["$key attr"]);
27 }
28
29 if( is_null( $value)) echo " />\n";
30 elseif(! is_array( $value)) echo '>', htmlspecialchars( $value),"</$tag>\n";
31 else echo ">\n",XML_serialize( $value, $level+1), str_repeat("\t", $level),"</$tag>\n";
32 }
33 reset( $data);
34 if( $level == 0){ $str = & ob_get_contents(); ob_end_clean(); return $str; }
35 }
36
37 class XML{
38 var $parser; # a reference to the XML parser
39 var $document; # the entire XML structure built up so far
40 var $parent; # a pointer to the current parent - the parent will be an array
41 var $stack; # a stack of the most recent parent at each nesting level
42 var $last_opened_tag; # keeps track of the last tag opened.
43
44 function XML(){
45 $this->parser = & xml_parser_create();
46 xml_parser_set_option( $this->parser, XML_OPTION_CASE_FOLDING, false);
47 xml_set_object( $this->parser, $this);
48 xml_set_element_handler( $this->parser, 'open','close');
49 xml_set_character_data_handler( $this->parser, 'data');
50 }
51 function destruct(){ xml_parser_free( $this->parser); }
52 function & parse(& $data){
53 $this->document = array();
54 $this->stack = array();
55 $this->parent = & $this->document;
56 return xml_parse( $this->parser, $data, true) ? $this->document : NULL;
57 }
58 function open(& $parser, $tag, $attributes){
59 $this->data = ''; # stores temporary cdata
60 $this->last_opened_tag = $tag;
61 if( is_array( $this->parent) and array_key_exists( $tag, $this->parent)){ # if you've seen this tag before
62 if( is_array( $this->parent[ $tag]) and array_key_exists(0, $this->parent[ $tag])){ # if the keys are numeric
63 # this is the third or later instance of $tag we've come across
64 $key = count_numeric_items( $this->parent[ $tag]);
65 } else{
66 # this is the second instance of $tag that we've seen. shift around
67 if( array_key_exists("$tag attr", $this->parent)){
68 $arr = array('0 attr'=>& $this->parent["$tag attr"], & $this->parent[ $tag]);
69 unset( $this->parent["$tag attr"]);
70 } else{
71 $arr = array(& $this->parent[ $tag]);
72 }
73 $this->parent[ $tag] = & $arr;
74 $key = 1;
75 }
76 $this->parent = & $this->parent[ $tag];
77 } else{
78 $key = $tag;
79 }
80 if( $attributes) $this->parent["$key attr"] = $attributes;
81 $this->parent = & $this->parent[ $key];
82 $this->stack[] = & $this->parent;
83 }
84 function data(& $parser, $data){
85 if( $this->last_opened_tag != NULL) # you don't need to store whitespace in between tags
86 $this->data .= $data;
87 }
88 function close(& $parser, $tag){
89 if( $this->last_opened_tag == $tag){
90 $this->parent = $this->data;
91 $this->last_opened_tag = NULL;
92 }
93 array_pop( $this->stack);
94 if( $this->stack) $this->parent = & $this->stack[ count( $this->stack)-1];
95 }
96 }
97 function count_numeric_items(& $array){
98 return is_array( $array) ? count( array_filter( array_keys( $array), 'is_numeric')) : 0;
99 }
100
101 ?>
102