From 9d38bf3e97c0e0e87a5ce9172abb167d147282d8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 4 Mar 2020 20:35:40 +0100 Subject: [PATCH] some fixes for errors in phpUnit in CalDAV tests --- setup/inc/functions.inc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index e24cbd8a9f..b8261eebee 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -25,9 +25,9 @@ $GLOBALS['egw_info'] = array( 'currentapp' => 'setup', 'noapi' => True )); -if(file_exists('../header.inc.php')) +if(file_exists(__DIR__.'/../../header.inc.php')) { - include('../header.inc.php'); + include_once(__DIR__.'/../../header.inc.php'); } // for an old header we need to setup a reference for the domains if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =& $GLOBALS['phpgw_domain']; @@ -56,14 +56,17 @@ require_once(EGW_INCLUDE_ROOT . '/api/src/loader/common.php'); * function to handle multilanguage support * */ -function lang($key,$vars=null) +if (!function_exists('lang')) { - if(!is_array($vars)) + function lang($key, $vars = null) { - $vars = func_get_args(); - array_shift($vars); // remove $key + if (!is_array($vars)) + { + $vars = func_get_args(); + array_shift($vars); // remove $key + } + return $GLOBALS['egw_setup']->translation->translate("$key", $vars); } - return $GLOBALS['egw_setup']->translation->translate("$key", $vars); } if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'))