From 9804ff609d64ec92744c91ca5c04cda04066c762 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sun, 17 Feb 2002 20:00:28 +0000 Subject: [PATCH] Apply modified patch from Ralf Becker to allow for use within phpgw (not setup) --- setup/inc/class.schema_proc.inc.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/setup/inc/class.schema_proc.inc.php b/setup/inc/class.schema_proc.inc.php index 10583d37eb..9f8aba720a 100644 --- a/setup/inc/class.schema_proc.inc.php +++ b/setup/inc/class.schema_proc.inc.php @@ -21,13 +21,24 @@ function schema_proc($dbms) { - include('./inc/class.schema_proc_' . $dbms . '.inc.php'); + if(@is_object($GLOBALS['phpgw'])) + { + /* this allows usage from within phpgw */ + $basedir = PHPGW_SERVER_ROOT . '/setup/'; + } + else + { + $basedir = './'; + } + + include($basedir . 'inc/class.schema_proc_' . $dbms . '.inc.php'); eval("\$this->m_oTranslator = new schema_proc_$dbms;"); - include('./inc/class.schema_proc_array.inc.php'); + include($basedir . 'inc/class.schema_proc_array.inc.php'); + $this->m_oDeltaProc = new schema_proc_array; $this->m_aTables = array(); - $this->m_bDeltaOnly = false; // Default to false here in case it's just a CreateTable script + $this->m_bDeltaOnly = False; // Default to false here in case it's just a CreateTable script } function GenerateScripts($aTables, $bOutputHTML = false)