浏览 3914 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
最后更新时间:2005-02-01
http://www.blogcn.com/user27/zbw25/blog/6044114.html
我们现在的文档都是记录在Wiki里的,CVSTrac是一个Open Source的Web方式CVS管理工具, 并且还包括了里程碑、时间线、Wiki等等功能。但是由于CVSTrac的Wiki功能太弱,所以我们 选用了MediaWiki。 CVSTrac中内置了一个文件型数据库SQLite,CVSTrac需要使用的数据库,在代码db.c中有介绍。
CREATE TABLE chng(
cn integer primary key, -- A unique "change" number
date int, -- Time commit occured in seconds since 1970
branch text, -- Name of branch or '' if main trunk
milestone int, -- 0: not a milestone. 1: release, 2: event
user text, -- User who did the commit
message text -- Text of the log message
);
CREATE TABLE filechng(
cn int, -- Corresponds to CHNG.CN field
filename text, -- Name of the file
vers text, -- New version number on this file
nins int, ndel int -- Number of lines inserted and deleted
);
CREATE TABLE ticket(
tn integer primary key, -- Unique tracking number for the ticket
type text, -- code, doc, todo, new, or event
status text, -- new, review, defer, active, fixed,
-- tested, or closed
origtime int, -- Time this ticket was first created
changetime int, -- Time of most recent change to this ticket
derivedfrom int, -- This ticket derived from another
version text, -- Version or build number containing the problem
assignedto text, -- Whose job is it to deal with this ticket
severity int, -- How bad is the problem
priority text, -- When should the problem be fixed
subsystem text, -- What subsystem does this ticket refer to
owner text, -- Who originally wrote this ticket
title text, -- Title of this bug
description text, -- Description of the problem
remarks text, -- How the problem was dealt with
contact text -- Contact information for the owner
);
CREATE TABLE tktchng(
tn int, -- Bug number
user text, -- User that made the change
chngtime int, -- Time of the change
fieldid text, -- Name of the field that changed
oldval text, -- Previous value of the field
newval text -- New value of the field
);
CREATE TABLE config(
name text primary key, -- Name of the configuration parameter
value text -- Value of the configuration parameter
);
CREATE TABLE user(
id text primary key, -- The user ID
name text, -- Complete name of the user
email text, -- E-mail address for this user
passwd text, -- User password
notify text, -- Type of e-mail to receive
http text, -- URL used by this user to access the site
capabilities text -- What this user is allowed to do
);
CREATE TABLE reportfmt(
rn integer primary key, -- Report number
owner text, -- Owner of this report format (not used)
title text, -- Title of this report
cols text, -- A color-key specification
sqlcode text -- An SQL SELECT statement for this report
);
可以通过php读写这种数据库,在Windows下要加上一个php_sqlite.dll。 因此,我将这个数据库文件从CVSTrac中去处,然后再通过php查询,就可以得到开发者 每天更新的文件,以及相关注释。这样一来,大家在开发的过程中,就可以随时随地的写下改写的注释, 然后就可以自动归入wiki之中了。 php代码:
<?
$str="";
if ($db = sqlite_open('xxxx.db', 0666, $sqliteerror)){
$starttime=mktime(0,0,0,date("n"),date("j"),date("Y"));
$result = sqlite_query($db, "SELECT * FROM chng where user='".strtolower($user)."' and date>=".$starttime." order by cn desc");
while($a=sqlite_fetch_array($result)){
$str=$str."*".date("Y-m-d H-i-s",intval($a["date"]))." ";
$str=$str.$a["message"]."\n";
$result1 = sqlite_query($db, "SELECT * FROM filechng where cn=".$a["cn"]);
while($b=sqlite_fetch_array($result1)){
$str=$str."**".$b["filename"]." ";
$str=$str."增加".$b["nins"]."行 ";
$str=$str."删除".$b["ndel"]."行 \n";
}
}
} else {
die($sqliteerror);
}
?>
<FORM NAME="Form1">
<TEXTAREA NAME="text" ROWS="10" COLS="80"><?echo $str?></TEXTAREA>
</FORM>
<a href="#" onclick="opener.document.editform.wpTextbox1.value=opener.document.editform.wpTextbox1.value+Form1.text.value;window.close()">确定</a>
?>
声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |
|
最后更新时间:2005-02-18
Have you tried SubVersion & Trac? It's a good combination of source management, bug tracking and wiki. Trac also supports writing Macro(plugins) in Python.
Trac: http://projects.edgewall.com/trac/ But SubVersion needs some full functional plugins for pop IDEs. |
|
| 返回顶楼 | |





