Integrate APPDB with Bugzilla to use the versions table from Bugzilla.
This commit is contained in:
59
README
59
README
@@ -1,32 +1,71 @@
|
|||||||
WineHQ Application Database
|
WineHQ Application Database
|
||||||
------------------------------------------------------------------------
|
#------------------------------------------------------------------------#
|
||||||
Authors:
|
Authors:
|
||||||
Jeremy Newman <jnewman@codeweavers.com>
|
Jeremy Newman <jnewman@codeweavers.com>
|
||||||
Charles Leop <charles@codeweavers.com>
|
Charles Leop <charles@codeweavers.com>
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
Paul van Schayck <info@wwwdesign.tmfweb.nl>
|
Paul van Schayck <polleke@gmail.com>
|
||||||
Chris Morgan <cmorgan@alum.wpi.edu>
|
Chris Morgan <cmorgan@alum.wpi.edu>
|
||||||
|
Tony Lambregts <tony_lambregts@telusplanet.net>
|
||||||
|
Jonathan Ernst <Jonathan@ErnstFamily.ch>
|
||||||
|
|
||||||
To install locally for testing/hacking:
|
To install locally for testing/hacking:
|
||||||
------------------------------------------------------------------------
|
#------------------------------------------------------------------------#
|
||||||
|
|
||||||
- Symlink from /var/www to the appdb directory
|
# Symlink from /var/www to the appdb directory
|
||||||
|
|
||||||
- Copy include/config.php.sample to include/config.php
|
# Copy include/config.php.sample to include/config.php
|
||||||
|
|
||||||
- Edit include/config.php as you see fit, the default name of the database
|
# Edit include/config.php as you see fit, the default name of the database
|
||||||
used in the table creation step below is "apidb", you'll have to modify
|
used in the table creation step below is "apidb", you'll have to modify
|
||||||
these files if you change this in config.php
|
these files if you change this in config.php
|
||||||
|
|
||||||
- cd tables, run ./create_tables to create the database tables
|
# cd tables, run ./create_tables to create the database tables
|
||||||
|
|
||||||
- Try to open up localhost/appdb, if you get a directory listing
|
# Try to open up localhost/appdb, if you get a directory listing
|
||||||
Edit your /etc/apache/httpd.conf "DirectoryIndex" to include index.php
|
Edit your /etc/apache/httpd.conf "DirectoryIndex" to include index.php
|
||||||
so apache will open index.php after not finding index.html/index.htm etc
|
so apache will open index.php after not finding index.html/index.htm etc
|
||||||
|
|
||||||
- Check your /etc/php/php.ini to ensure that
|
# Check your /etc/php/php.ini to ensure that
|
||||||
'register_globals = On' (variables won't get passed)
|
'register_globals = On' (variables won't get passed)
|
||||||
'magic_quotes_gpc = Off' (you would end up with \ everywhere)
|
'magic_quotes_gpc = Off' (you would end up with \ everywhere)
|
||||||
'session.bug_compat_42' = On' (Problem with auto-globals and session variables)
|
'session.bug_compat_42' = On' (Problem with auto-globals and session variables)
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------#
|
||||||
|
You can create ether set up a real bugzilla database or a fake one
|
||||||
|
|
||||||
|
# cd tables, run ./create_bugzilla_tables to create the fake bugzilla tables
|
||||||
|
#------------------------------------------------------------------------#
|
||||||
|
# or installing a real bugzilla database (hope this helps)
|
||||||
|
|
||||||
|
# download buzilla (password for cvs is cvs)
|
||||||
|
|
||||||
|
cd /var/www/html
|
||||||
|
export CVSROOT=:pserver:cvs@cvs.winehq.org:/home/wine
|
||||||
|
cvs login
|
||||||
|
cvs -z 0 checkout bugzilla
|
||||||
|
|
||||||
|
# change directory to bugzilla and change the group ownership to apache.
|
||||||
|
|
||||||
|
cd bugzilla
|
||||||
|
chgrp -R apache .
|
||||||
|
chmod -R g+rX .
|
||||||
|
|
||||||
|
|
||||||
|
# change to su and run ./checksetup.pl and fix up what it finds wrong.
|
||||||
|
# this may take several runs
|
||||||
|
|
||||||
|
su
|
||||||
|
./checksetup.pl
|
||||||
|
|
||||||
|
# in the /etc/httpd/conf/hppt.conf file find "AddHandler cgi-script .cgi" and add the following.
|
||||||
|
|
||||||
|
<Directory "/var/www/html/bugzilla">
|
||||||
|
Options ExecCGI
|
||||||
|
AllowOverride Limit
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
# edit local config as nessary to allow access.
|
||||||
|
|||||||
@@ -26,4 +26,14 @@ $userdb_dbpass = "lemonade";
|
|||||||
$userdb_dbhost = "localhost";
|
$userdb_dbhost = "localhost";
|
||||||
$userdb_db = "apidb";
|
$userdb_db = "apidb";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bugzilla database info
|
||||||
|
*/
|
||||||
|
$bugzilla_dbuser = "root";
|
||||||
|
$bugzilla_dbpass = "";
|
||||||
|
$bugzilla_dbhost = "localhost";
|
||||||
|
$bugzilla_db = "bugs";
|
||||||
|
/* $bugzilla_db_port = 3306; is this needed? I dont think so.*/
|
||||||
|
$bugzilla_product_id = 1;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -171,6 +171,68 @@ function get_xml_tag ($file, $mode = null)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* bugzilla functions */
|
||||||
|
|
||||||
|
function openbugzilladb()
|
||||||
|
{
|
||||||
|
global $bugzilla_dbuser, $bugzilla_dbpass, $bugzilla_dbhost, $bugzilla_db, $bugzilla_product_id;
|
||||||
|
global $dbcon, $dbref;
|
||||||
|
|
||||||
|
$dbref++;
|
||||||
|
|
||||||
|
if($dbcon)
|
||||||
|
return $dbcon;
|
||||||
|
|
||||||
|
$dbcon = mysql_connect($bugzilla_dbhost, $bugzilla_dbuser, $bugzilla_dbpass);
|
||||||
|
if(!$dbcon)
|
||||||
|
{
|
||||||
|
echo "An error occurred: ".mysql_error()."<p>\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
mysql_select_db($bugzilla_db);
|
||||||
|
return $dbcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
function closebugzilladb()
|
||||||
|
{
|
||||||
|
global $dbcon, $dbref;
|
||||||
|
|
||||||
|
if(--$dbref)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mysql_close($adbcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
function make_bugzilla_version_list($varname, $cvalue)
|
||||||
|
{
|
||||||
|
global $bugzilla_db, $bugzilla_product_id;
|
||||||
|
|
||||||
|
$table = $bugzilla_db.".versions";
|
||||||
|
$where = "WHERE product_id=".$bugzilla_product_id;
|
||||||
|
$query = "SELECT value FROM $table $where ORDER BY value";
|
||||||
|
|
||||||
|
openbugzilladb();
|
||||||
|
|
||||||
|
$result = mysql_query($query);
|
||||||
|
|
||||||
|
if(!$result)
|
||||||
|
{
|
||||||
|
closebugzilladb();
|
||||||
|
return; // Oops
|
||||||
|
}
|
||||||
|
echo "<select name='$varname'>\n";
|
||||||
|
echo "<option value=0>Choose ...</option>\n";
|
||||||
|
while(list($value) = mysql_fetch_row($result))
|
||||||
|
{
|
||||||
|
if($id == $cvalue)
|
||||||
|
echo "<option value=$value selected>$value\n";
|
||||||
|
else
|
||||||
|
echo "<option value=$value>$value\n";
|
||||||
|
}
|
||||||
|
echo "</select>\n";
|
||||||
|
closebugzilladb();
|
||||||
|
}
|
||||||
|
|
||||||
/* get the number of applications in the appQueue table */
|
/* get the number of applications in the appQueue table */
|
||||||
function getQueuedAppCount()
|
function getQueuedAppCount()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ function show_user_fields()
|
|||||||
$ext_email = $user->lookup_email($_SESSION['current']->userid);
|
$ext_email = $user->lookup_email($_SESSION['current']->userid);
|
||||||
|
|
||||||
include(BASE."include/"."form_edit.php");
|
include(BASE."include/"."form_edit.php");
|
||||||
|
$version = "unspecified";
|
||||||
|
echo "<tr><td> wine version </td><td>";
|
||||||
|
make_bugzilla_version_list("version", $version);
|
||||||
|
echo "</td></tr>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($HTTP_POST_VARS)
|
if($HTTP_POST_VARS)
|
||||||
|
|||||||
62
tables/bugzilla_tables.sql
Normal file
62
tables/bugzilla_tables.sql
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
create database if not exists bugs;
|
||||||
|
|
||||||
|
use bugs;
|
||||||
|
|
||||||
|
drop table if exists versions;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* versions information
|
||||||
|
*/
|
||||||
|
create table versions (
|
||||||
|
value tinytext,
|
||||||
|
product_id smallint not null
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO versions VALUES ('unspecified', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010112', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010216', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010305', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010326', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010418', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010510', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010629', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20010824', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20011004', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20011108', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020228', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020310', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020411', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020509', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020605', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020710', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020804', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20020904', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20021007', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20021031', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20021125', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20021219', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030115', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030219', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030318', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030408', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030508', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030618', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030709', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030813', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20030911', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20031016', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20031118', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20031212', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040121', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040213', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040309', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040408', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040505', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040615', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040716', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040813', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20040914', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20041019', 1 );
|
||||||
|
INSERT INTO versions VALUES ('20041201', 1 );
|
||||||
|
INSERT INTO versions VALUES ('CVS', 1 );
|
||||||
4
tables/create_bugzilla_tables
Normal file
4
tables/create_bugzilla_tables
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
echo Creating fake Bugzilla tables
|
||||||
|
mysql -u root < bugzilla_tables.sql
|
||||||
Reference in New Issue
Block a user