|
From: John W. <jp...@us...> - 2002-04-04 23:38:05
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv25430
Modified Files:
install.php
Log Message:
Allow Smarty to be used in install.php from locations other than include path (define)
Basic error checking on initial connection to database
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- install.php 3 Apr 2002 23:21:30 -0000 1.21
+++ install.php 4 Apr 2002 23:30:42 -0000 1.22
@@ -25,7 +25,12 @@
define ('INSTALL_PATH', dirname(__FILE__));
-if (!@include('Smarty.class.php')) { // Template class
+// Location of smarty templates class
+ define ('SMARTY_PATH','');
+ // Example if smarty is installed within the phpBugTracker tree.
+ //define ('SMARTY_PATH','./inc/smarty/');
+
+if (!@include(SMARTY_PATH . '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.
@@ -160,6 +165,18 @@
'password' => $_pv['db_pass']
);
$db = DB::Connect($dsn);
+ // Simple error checking on returned DB object to check connection to db
+ if(get_class($db)=='db_error') {
+ die('<br><br>
+ <div align="center">The installation script could not connect to the database (' . $_pv['db_database'] .
+ ') on the host (' . $_pv['db_host'] . ') using the specified username and password.
+ <br>
+ Please check these details are correct and that the database already exists then retry.
+ </div>
+ ');
+ }
+
+
$db->setOption('optimize', 'portability');
$q_temp_ary = file('schemas/'.$_pv['db_type'].'.in');
@@ -255,7 +272,5 @@
} else {
show_front();
}
-
+// Any whitespace below the end tag will disrupt config.php
?>
-
-
|