blob: 77eb02f1477dd7aacfc3719700a05e4f045e8b91 [file] [log] [blame]
<?php
require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_bugs_ro.class.php";
/*
* Basic connection to Bugzilla and auto-select the "bugs" DB
*
*/
function bugzilla_connect() {
global $dbc;
$dbc = new DBConnectionBugs();
$dbh = $dbc->connect();
if (!$dbh) {
trigger_error("Couldn't connect to Bugzilla DB", E_USER_ERROR);
} else {
if ( !$tsProductId ) {
create_ts_globals($link);
}
return $link;
}
}
function create_ts_globals($dbh) {
// The main product name
global $tsProductId, $tsProductName;
echo "looking up product ID</br>";
$result = mysql_query("SELECT id, name FROM products WHERE name=\"Tigerstripe\"", $dbh);
if(mysql_errno($dbh) > 0) {
echo "There was an error processing this request";
# For debugging purposes - don't display this stuff in a production page.
# echo mysql_error($dbh);
# Mysql disconnects automatically, but I like my disconnects to be explicit.
$dbc->disconnect();
exit;
}
while($row = mysql_fetch_assoc($result)) {
$tsProductId = $row['id'];
$tsProductName = $row['name'];
}
// all the milestones
global $milestones;
$result = mysql_query("SELECT value FROM milestones WHERE product_id = \"$tsProductId\" ORDER BY sortkey,value DESC", $dbh);
while($row = mysql_fetch_assoc($result)) {
$milestones[] = $row['value'];
}
}
/*
* Basic close for connection
*
*/
function bugzilla_close( $link ) {
$dbc->disconnect();
$dbc = null;
}
?>