From 408a951b2301a388258d6f806750ee961ae1a805 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 3 Jun 2006 14:45:49 +0000 Subject: [PATCH] small fix to be able to upgrade a pre 1.2 header --- setup/inc/class.setup_header.inc.php | 2 +- setup/inc/functions.inc.php | 17 ++++++++++++----- setup/setup-cli.php | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/setup/inc/class.setup_header.inc.php b/setup/inc/class.setup_header.inc.php index 8b17b6fc4d..259301ca26 100644 --- a/setup/inc/class.setup_header.inc.php +++ b/setup/inc/class.setup_header.inc.php @@ -149,7 +149,7 @@ class setup_header /** * generate header.inc.php file from given values * - * setup_header::generate(EGW_SERVER_ROOT,EGW_INCLUDE_ROOT,$GLOBALS['egw_info'],$GLOBALS['egw_domains']) + * setup_header::generate($GLOBALS['egw_info'],$GLOBALS['egw_domains']) * should write an identical header.inc.php as the one include * * @param array $egw_info usual content (in server key) plus keys server_root and include_root diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index 62ce9f87c0..43269e8116 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -35,11 +35,18 @@ /* If we included the header.inc.php, but it is somehow broken, cover ourselves... */ if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT')) { - define('EGW_SERVER_ROOT','..'); - define('EGW_INCLUDE_ROOT','..'); - define('PHPGW_SERVER_ROOT','..'); - define('PHPGW_INCLUDE_ROOT','..'); - + if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT')) // pre 1.2 install + { + define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT); + define('EGW_INCLUDE_ROOT',PHPGW_INCLUDE_ROOT); + } + else // no install + { + define('EGW_SERVER_ROOT','..'); + define('EGW_INCLUDE_ROOT','..'); + define('PHPGW_SERVER_ROOT','..'); + define('PHPGW_INCLUDE_ROOT','..'); + } define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc'); } diff --git a/setup/setup-cli.php b/setup/setup-cli.php index 45896a5727..5107f3497e 100755 --- a/setup/setup-cli.php +++ b/setup/setup-cli.php @@ -53,6 +53,7 @@ switch($action) case '--create-header': case '--edit-header': case '--upgrade-header': + case '--update-header': do_header($action == '--create-header',$arguments); break; @@ -535,7 +536,7 @@ function do_check($domain='',$stop=0) echo lang("database is version %1 and up to date.",$setup_info['phpgwapi']['currentver'])."\n"; $GLOBALS['egw_setup']->detection->check_config(); - if ($GLOBALS['egw_info']['setup']['config_errors'] && !in_array(15,$stop)) + if ($GLOBALS['egw_info']['setup']['config_errors'] && $stop && !in_array(15,$stop)) { fail(15,lang('You need to configure eGroupWare:')."\n- ".@implode("\n- ",$GLOBALS['egw_info']['setup']['config_errors'])); } @@ -705,8 +706,7 @@ function do_header($create,&$arguments) echo "\n".lang('Configuration errors:')."\n- ".implode("\n- ",$errors)."\n"; fail(23,lang("You need to fix the above errors, before the configuration file header.inc.php can be written!")); } - $header = $GLOBALS['egw_setup']->header->generate($GLOBALS['egw_info'],$GLOBALS['egw_domain'], - $GLOBALS['egw_info']['server']['server_root'],$GLOBALS['egw_info']['server']['include_root']); + $header = $GLOBALS['egw_setup']->header->generate($GLOBALS['egw_info'],$GLOBALS['egw_domain']); echo $header;