|
From: Benjamin C. <bc...@us...> - 2002-04-08 17:05:57
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv29288
Modified Files:
upgrade.php
Log Message:
Don't include smarty twice (include.php is the first time). Move error messages to templates. Add bug dependency table. Set the default style so include.php won't complain when assigning it to the template.
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- upgrade.php 3 Apr 2002 18:18:02 -0000 1.21
+++ upgrade.php 8 Apr 2002 17:05:52 -0000 1.22
@@ -23,6 +23,8 @@
// $Id$
define ('NO_AUTH', 1);
+define ('STYLE', 'default');
+
include 'include.php';
function upgrade() {
@@ -31,22 +33,9 @@
// Note, no upgrades for oracle since we didn't support oracle before 0.8.0
$upgraded = $db->getOne('select varname from '.TBL_CONFIGURATION.' where varname = \'FORCE_LOGIN\'');
if (!$upgraded or DB::isError($upgraded)) {
- if (!@include('Smarty.class.php')) { // Template class
- die('<br><br>
- <div align="center">The Smarty templates class is not in your include path.
- Without this class being available, phpBugTracker will not be able to work.
- Please visit <a href="http://www.phpinsider.com/php/code/Smarty/">the smarty
- website</a> and install the package. Please reload this page when smarty
- has been installed.</div>
- ');
- }
if (!@is_writeable('c_templates')) {
- die('<br><br>
- <div align="center">The "c_templates" subdirectory is not writeable by the
- web process. This needs to be corrected before the upgrade can proceed
- so the templates can be compiled by smarty. Please reload this page when
- this has been corrected.</div>
- ');
+ include('templates/default/base/templatesperm.html');
+ exit;
}
// Convert the sequences
if (DB_TYPE == 'mysql') {
@@ -57,6 +46,7 @@
if (DB_TYPE == 'pgsql') {
// Set up the user prefs table
$db->query("CREATE TABLE ".TBL_USER_PREF." ( user_id INT4 NOT NULL DEFAULT '0', email_notices INT2 NOT NULL DEFAULT '1', PRIMARY KEY (user_id) )");
+ $db->query("CREATE TABLE ".TBL_BUG_DEPENDENCY." ( bug_id INT4 NOT NULL DEFAULT '0', depends_on INT4 NOT NULL DEFAULT '0', PRIMARY KEY (bug_id,depends_on) )");
$db->query("insert into ".TBL_USER_PREF." (user_id) select user_id from ".TBL_AUTH_USER);
// Move the sequences
while ($rs->fetchInto($row)) {
@@ -65,6 +55,7 @@
} else {
// Set up the user prefs table
$db->query("CREATE TABLE ".TBL_USER_PREF." ( user_id int(11) NOT NULL default '0', email_notices tinyint(1) NOT NULL default '1', PRIMARY KEY (user_id) )");
+ $db->query("CREATE TABLE ".TBL_BUG_DEPENDENCY." ( bug_id int(10) unsigned NOT NULL default '0', depends_on int(10) unsigned NOT NULL default '0', PRIMARY KEY (bug_id,depends_on) )");
$db->query("insert into ".TBL_USER_PREF." (user_id) select user_id from ".TBL_AUTH_USER);
// Move the sequences
while ($rs->fetchInto($row)) {
|