From 8a03d86b3621c38a06f590e617cf0cfd9756abb0 Mon Sep 17 00:00:00 2001 From: Alexandre Rosenfeld Date: Mon, 6 Jun 2011 11:21:19 -0400 Subject: [PATCH] BUG 6735 Move env.ini handling to paths.php (avoid warnings) Since the upgrade command was not using env.ini, some warnings were raised because of missing timezone information. Moving this code to paths.php makes sure env.ini will be used even for upgrades. --- workflow/engine/config/paths.php | 42 +++++++++++++++++++++++++++++ workflow/public_html/sysGeneric.php | 41 ---------------------------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/workflow/engine/config/paths.php b/workflow/engine/config/paths.php index c9c19c45b..e966376f1 100644 --- a/workflow/engine/config/paths.php +++ b/workflow/engine/config/paths.php @@ -23,6 +23,48 @@ * */ + /* Default configuration values (do not change these, use env.ini) */ + $default_config = array( + 'debug' => 0, + 'debug_sql' => 0, + 'debug_time' => 0, + 'debug_calendar' => 0, + 'wsdl_cache' => 1, + 'memory_limit' => '100M', + 'time_zone' => 'America/La_Paz' + ); + + /* Read the env.ini */ + $env_file = realpath(dirname(__FILE__) . "/env.ini"); + $config = $default_config; + if ($env_file !== false && file_exists($env_file)) { + $ini_contents = parse_ini_file($env_file, false); + if ($ini_contents !== false) + $config = array_merge($default_config, $ini_contents); + } + + if ($config['debug']) { + $config['debug_sql'] = 1; + } + +//*** Do not change any of these settings directly, use env.ini instead + ini_set('display_errors','On'); + + ini_set('short_open_tag', 'on'); + ini_set('asp_tags', 'on'); + ini_set('register_globals', 'off'); + ini_set('default_charset', "UTF-8"); + $e_all = defined('E_DEPRECATED') ? E_ALL ^ E_DEPRECATED : E_ALL; + ini_set('error_reporting', ($config['debug'] ? $e_all : $e_all ^ E_NOTICE) ); + ini_set('memory_limit', $config['memory_limit']); + ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']); + + define ('DEBUG_SQL_LOG', $config['debug_sql'] ); + define ('DEBUG_TIME_LOG', $config['debug_time'] ); + define ('DEBUG_CALENDAR_LOG', $config['debug_calendar'] ); + + define ('TIME_ZONE', $config['time_zone']); + //***************** System Directories & Paths ************************** //***************** RBAC Paths ************************** diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 6cf5dbb33..611c65056 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -2,47 +2,6 @@ //sysGeneric, this file is used initialize main variables and redirect to each and all pages $startingTime = array_sum(explode(' ',microtime())); - /* Default configuration values (do not change these, use env.ini) */ - $default_config = array( - 'debug' => 0, - 'debug_sql' => 0, - 'debug_time' => 0, - 'debug_calendar' => 0, - 'wsdl_cache' => 1, - 'memory_limit' => '100M', - 'time_zone' => 'America/La_Paz' - ); - - /* Read the env.ini */ - $env_file = realpath(dirname(__FILE__) . "/../engine/config/env.ini"); - if ($env_file !== false && file_exists($env_file)) { - $config = array_merge($default_config, parse_ini_file($env_file, false)); - } else { - $config = $default_config; - } - - if ($config['debug']) { - $config['debug_sql'] = 1; - } - -//*** Do not change any of these settings directly, use env.ini instead - ini_set('display_errors','On'); - - ini_set('short_open_tag', 'on'); - ini_set('asp_tags', 'on'); - ini_set('register_globals', 'off'); - ini_set('default_charset', "UTF-8"); - $e_all = defined('E_DEPRECATED') ? E_ALL ^ E_DEPRECATED : E_ALL; - ini_set('error_reporting', ($config['debug'] ? $e_all : $e_all ^ E_NOTICE) ); - ini_set('memory_limit', $config['memory_limit']); - ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']); - - define ('DEBUG_SQL_LOG', $config['debug_sql'] ); - define ('DEBUG_TIME_LOG', $config['debug_time'] ); - define ('DEBUG_CALENDAR_LOG', $config['debug_calendar'] ); - - define ('TIME_ZONE', $config['time_zone']); - //*** process the $_POST with magic_quotes enabled function strip_slashes(&$vVar) { if (is_array($vVar)) {