|
From: Benjamin C. <bc...@us...> - 2002-10-11 20:53:56
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv13789
Modified Files:
include.php install.php
Log Message:
Fixes bug #618567 - PEAR distributed with phpBT was conflicting with system-wide PEAR.
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -r1.123 -r1.124
--- include.php 23 Sep 2002 20:48:21 -0000 1.123
+++ include.php 11 Oct 2002 20:53:53 -0000 1.124
@@ -37,8 +37,8 @@
include ('inc/functions.php');
// PEAR::DB
-chdir('inc/pear'); // Drop down to the pear directory to include pear stuff
-require_once('DB.php');
+define('PEAR_PATH', 'inc/pear/'); // Set this to '' to use system-wide PEAR
+require_once(PEAR_PATH.'DB.php');
$dsn = array(
'phptype' => DB_TYPE,
'hostspec' => DB_HOST,
@@ -53,7 +53,6 @@
$db->setOption('optimize', 'portability');
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$db->setErrorHandling(PEAR_ERROR_CALLBACK, "handle_db_error");
-chdir('../..'); // Come back up from the pear directory
// Set up the configuration variables
$rs = $db->query('select varname, varvalue from '.TBL_CONFIGURATION);
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- install.php 2 Oct 2002 18:43:46 -0000 1.33
+++ install.php 11 Oct 2002 20:53:53 -0000 1.34
@@ -146,8 +146,8 @@
}
function test_database(&$params, $testonly = false) {
// PEAR::DB
- chdir('inc/pear'); // Drop down to the pear directory to include pear stuff
- require_once('DB.php');
+ define('PEAR_PATH', 'inc/pear/'); // Set this to '' to use system-wide PEAR
+ require_once(PEAR_PATH.'DB.php');
$dsn = array(
'phptype' => $params['db_type'],
'hostspec' => $params['db_host'],
@@ -156,7 +156,6 @@
'password' => $params['db_pass']
);
$db = DB::Connect($dsn);
- chdir('../..'); // Come back up from the pear directory
// Simple error checking on returned DB object to check connection to db
if (get_class($db) == 'db_error') {
|