From 412967ce18f859849823116340d1a3ef0ca91821 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Thu, 12 Apr 2012 18:47:00 -0400 Subject: [PATCH] BUG 8978 "Upgrade de la version 2.0.39 a la version 2.0.40 no ..." SOLVED - for some php versions date.timezone is not configurated by default, that why th problem - on cli.php date.timezone is being configurated now, if env.ini exists, its configuration in read --- processmaker | 3 +-- workflow/engine/bin/cli.php | 27 +++++++++++++++++++----- workflow/engine/classes/class.system.php | 6 +++--- workflow/public_html/sysGeneric.php | 1 + 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/processmaker b/processmaker index a08847449..81436e53e 100755 --- a/processmaker +++ b/processmaker @@ -7,6 +7,5 @@ define("WORKFLOW_PATH", $scriptDir . 'workflow/'); define("WORKFLOW_BIN_PATH", $scriptDir . 'workflow/engine/bin/'); - include ( WORKFLOW_BIN_PATH . '/cli.php'); + include WORKFLOW_BIN_PATH . '/cli.php'; -?> diff --git a/workflow/engine/bin/cli.php b/workflow/engine/bin/cli.php index e3a46f080..30b0bb317 100755 --- a/workflow/engine/bin/cli.php +++ b/workflow/engine/bin/cli.php @@ -47,9 +47,28 @@ G::LoadClass("cli"); - /* Hide notice, otherwise we get a lot of messages */ - error_reporting(E_ALL ^ E_NOTICE); - ini_set('display_errors', 1); + require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php'; + $config = System::getSystemConfiguration(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'env.ini'); + + $e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL; + $e_all = defined('E_STRICT') ? E_ALL & ~E_STRICT : $e_all; + $e_all = $e_all & ~E_NOTICE; // don't notices + + // Do not change any of these settings directly, use env.ini instead + ini_set('display_errors', $config['debug']); + ini_set('error_reporting', $e_all); + ini_set('short_open_tag', 'On'); + ini_set('default_charset', "UTF-8"); + ini_set('memory_limit', $config['memory_limit']); + ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']); + ini_set('date.timezone', $config['time_zone']); + + define ('DEBUG_SQL_LOG', $config['debug_sql']); + define ('DEBUG_TIME_LOG', $config['debug_time']); + define ('DEBUG_CALENDAR_LOG', $config['debug_calendar']); + define ('MEMCACHED_ENABLED', $config['memcached']); + define ('MEMCACHED_SERVER', $config['memcached_server']); + define ('TIME_ZONE', $config['time_zone']); // trap -V before pake if (in_array('-v', $argv) || in_array('-V', $argv) || in_array('--version', $argv)) @@ -78,5 +97,3 @@ CLI::run(); exit(0); - -?> diff --git a/workflow/engine/classes/class.system.php b/workflow/engine/classes/class.system.php index 22b30d1b6..67ebbbc39 100755 --- a/workflow/engine/classes/class.system.php +++ b/workflow/engine/classes/class.system.php @@ -1030,13 +1030,13 @@ class System { /* Read the env.ini */ $ini_contents = parse_ini_file($iniFile, false); - - // validation debug config, ony accept bynary values, 1 to enable - $ini_contents['debug'] = $ini_contents['debug'] == 1 ? 1 : 0; if ($ini_contents !== false) { $config = array_merge($config, $ini_contents); } + + // validation debug config, ony accept bynary values, 1 to enable + $config['debug'] = $config['debug'] == 1 ? 1 : 0; return $config; } diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index cdf57cab9..1db635a0a 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -66,6 +66,7 @@ ini_set('default_charset', "UTF-8"); ini_set('memory_limit', $config['memory_limit']); ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']); + ini_set('date.timezone', $config['time_zone']); define ('DEBUG_SQL_LOG', $config['debug_sql']); define ('DEBUG_TIME_LOG', $config['debug_time']);