Index: trunk/globals.php =================================================================== diff -u -r3850 -r3866 --- trunk/globals.php (.../globals.php) (revision 3850) +++ trunk/globals.php (.../globals.php) (revision 3866) @@ -3,7 +3,7 @@ if (!function_exists('parse_portal_ini')) { function parse_portal_ini($file, $parse_section = false) { - if (!file_exists($file)) return; + if (!file_exists($file)) return false; if(file_exists($file) && !is_readable($file)) die('Could Not Open Ini File'); @@ -56,16 +56,14 @@ } } -$vars = parse_portal_ini(FULL_PATH.'/config.php'); + $vars = parse_portal_ini(FULL_PATH.'/config.php'); + if ($vars) { + foreach ($vars as $config_key => $config_value) { + $GLOBALS['g_'.$config_key] = $config_value; + } + unset($config_key, $config_value); + } -while($key = key($vars)) -{ - $key = "g_".$key; - global $$key; - $$key = current($vars); //variable variables - next($vars); -} - /*list the tables which contain item data */ $ItemTables = array(); @@ -1713,9 +1711,8 @@ */ function IsDebugMode($check_debugger = true) { - $debug_mode = defined('DEBUG_MODE') && DEBUG_MODE; - if($check_debugger) $debug_mode = $debug_mode && isset($GLOBALS['debugger']); - return $debug_mode; + $application =& kApplication::Instance(); + return $application->isDebugMode($check_debugger); } /** @@ -1725,7 +1722,8 @@ */ function IsAdmin() { - return defined('ADMIN') && constant('ADMIN') == 1 ? 1 : 0; + $application =& kApplication::Instance(); + return $application->IsAdmin(); } /**