|
From: Benjamin C. <bc...@us...> - 2002-03-17 01:39:34
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv4068
Modified Files:
install.php
Log Message:
Switching to PEAR::DB and changes for oracle support
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- install.php 13 Mar 2002 17:40:18 -0000 1.14
+++ install.php 17 Mar 2002 01:39:31 -0000 1.15
@@ -107,13 +107,9 @@
function create_tables() {
global $_pv, $tables;
- include_once(INSTALL_PATH.'/inc/db/'.$_pv['db_type'].'.php');
-
- $db = new DB_Sql;
- $db->Host = $_pv['db_host'];
- $db->Database = $_pv['db_database'];
- $db->User = $_pv['db_user'];
- $db->Password = $_pv['db_pass'];
+ // PEAR::DB
+ require_once('DB.php');
+ $db = DB::Connect($_pv['db_type'].'://'.$_pv['db_user'].':'.$_pv['db_pass'].'@'.$_pv['db_host'].'/'.$_pv['db_database']);
$q_temp_ary = file('schemas/'.$_pv['db_type'].'.in');
$queries = preg_replace(array_keys($tables), array_values($tables),
@@ -123,6 +119,9 @@
// First, collect multi-line queries into one line, then run the query
$do_query .= chop($query);
if (empty($do_query) or substr($do_query, -1) != ';') continue;
+ if ($_pv['db_type'] == 'oci8' ) {
+ $do_query = substr($do_query, 0, -1);
+ }
$db->query($do_query);
$do_query = '';
}
@@ -197,6 +196,7 @@
$db_types = array(
'mysql' => 'MySQL',
+ 'oci8' => 'Oracle 8.1.x',
'pgsql' => 'PostgreSQL');
foreach ($_pv as $k => $v) $$k = $v;
|