[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.db.inc.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.db.inc.php |
Date: |
Mon, 12 Mar 2007 14:46:18 +0000 |
CVSROOT: /sources/phpgwapi
Module name: phpgwapi
Changes by: Sigurd Nes <sigurdne> 07/03/12 14:46:18
Modified files:
inc : class.db.inc.php
Log message:
allows connection to second database on different server / servertype
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.db.inc.php?cvsroot=phpgwapi&r1=1.33&r2=1.34
Patches:
Index: class.db.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/class.db.inc.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- class.db.inc.php 11 Mar 2007 18:54:55 -0000 1.33
+++ class.db.inc.php 12 Mar 2007 14:46:18 -0000 1.34
@@ -9,7 +9,7 @@
* @link http://www.sanisoft.com/phplib/manual/DB_sql.php
* @package phpgwapi
* @subpackage database
- * @version $Id: class.db.inc.php,v 1.33 2007/03/11 18:54:55 sigurdne
Exp $
+ * @version $Id: class.db.inc.php,v 1.34 2007/03/12 14:46:18 sigurdne
Exp $
*/
if (empty($GLOBALS['phpgw_info']['server']['db_type']))
@@ -90,10 +90,15 @@
* Constructor
* @param string $query query to be executed (optional)
*/
- function db($query = '')
+ function db($query = '',$db_type = '')
{
+ if(!$db_type)
+ {
+ $db_type = $this->Type ? $this->Type :
$GLOBALS['phpgw_info']['server']['db_type'];
+ }
+
// We do it this way to allow it to be easily extended
in the future
- switch ( $GLOBALS['phpgw_info']['server']['db_type'] )
+ switch ( $db_type )
{
case 'postgres':
$this->join = " JOIN ";
@@ -103,7 +108,7 @@
//do nothing for now
}
- $this->adodb =
newADOConnection($GLOBALS['phpgw_info']['server']['db_type']);
+ $this->adodb = newADOConnection($db_type);
$this->adodb->SetFetchMode(3);
if($query != '')
{