mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 00:18:25 +01:00
- fix bug in egw_db so that it will always work with postgresql if using external db's
- enhance schema_proc so that it can work with schema's of externals db objects
This commit is contained in:
parent
7430c4d638
commit
c1c6bddace
@ -283,8 +283,11 @@
|
|||||||
{
|
{
|
||||||
$this->ServerInfo = $this->Link_ID->ServerInfo();
|
$this->ServerInfo = $this->Link_ID->ServerInfo();
|
||||||
$this->set_capabilities($type,$this->ServerInfo['version']);
|
$this->set_capabilities($type,$this->ServerInfo['version']);
|
||||||
|
if($Database)
|
||||||
|
{
|
||||||
$Ok = $this->Link_ID->SelectDB($Database);
|
$Ok = $this->Link_ID->SelectDB($Database);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!$Ok)
|
if (!$Ok)
|
||||||
{
|
{
|
||||||
$this->halt("ADOdb::$connect($Host, $User, \$Password, $Database) failed.");
|
$this->halt("ADOdb::$connect($Host, $User, \$Password, $Database) failed.");
|
||||||
|
@ -79,16 +79,25 @@
|
|||||||
* Constructor of schema-processor
|
* Constructor of schema-processor
|
||||||
*
|
*
|
||||||
* @param string $dbms type of the database: 'mysql','pgsql','mssql','sapdb'
|
* @param string $dbms type of the database: 'mysql','pgsql','mssql','sapdb'
|
||||||
|
* @param object $db=null database class, if null we use $GLOBALS['egw']->db
|
||||||
*/
|
*/
|
||||||
function schema_proc($dbms=False)
|
function schema_proc($dbms=False,$db=null)
|
||||||
|
{
|
||||||
|
if(is_object($db))
|
||||||
|
{
|
||||||
|
$this->m_odb = $db;
|
||||||
|
$this->adodb = &$this->m_odb->Link_ID;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$this->m_odb = is_object($GLOBALS['egw']->db) ? $GLOBALS['egw']->db : $GLOBALS['egw_setup']->db;
|
$this->m_odb = is_object($GLOBALS['egw']->db) ? $GLOBALS['egw']->db : $GLOBALS['egw_setup']->db;
|
||||||
|
$this->adodb = &$GLOBALS['egw']->ADOdb;
|
||||||
|
}
|
||||||
$this->m_odb->connect();
|
$this->m_odb->connect();
|
||||||
$this->capabilities =& $this->m_odb->capabilities;
|
$this->capabilities =& $this->m_odb->capabilities;
|
||||||
|
|
||||||
$this->sType = $dbms ? $dmbs : $this->m_odb->Type;
|
$this->sType = $dbms ? $dmbs : $this->m_odb->Type;
|
||||||
|
|
||||||
$this->adodb = &$GLOBALS['egw']->ADOdb;
|
|
||||||
$this->dict = NewDataDictionary($this->adodb);
|
$this->dict = NewDataDictionary($this->adodb);
|
||||||
|
|
||||||
// enable the debuging in ADOdb's datadictionary if the debug-level is greater then 1
|
// enable the debuging in ADOdb's datadictionary if the debug-level is greater then 1
|
||||||
|
Loading…
Reference in New Issue
Block a user