Skip to content

Commit 412967c

Browse files
author
Erik Amaru Ortiz
committed
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
1 parent 489861b commit 412967c

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

processmaker

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
define("WORKFLOW_PATH", $scriptDir . 'workflow/');
88
define("WORKFLOW_BIN_PATH", $scriptDir . 'workflow/engine/bin/');
99

10-
include ( WORKFLOW_BIN_PATH . '/cli.php');
10+
include WORKFLOW_BIN_PATH . '/cli.php';
1111

12-
?>

workflow/engine/bin/cli.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,28 @@
4747

4848
G::LoadClass("cli");
4949

50-
/* Hide notice, otherwise we get a lot of messages */
51-
error_reporting(E_ALL ^ E_NOTICE);
52-
ini_set('display_errors', 1);
50+
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
51+
$config = System::getSystemConfiguration(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'env.ini');
52+
53+
$e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL;
54+
$e_all = defined('E_STRICT') ? E_ALL & ~E_STRICT : $e_all;
55+
$e_all = $e_all & ~E_NOTICE; // don't notices
56+
57+
// Do not change any of these settings directly, use env.ini instead
58+
ini_set('display_errors', $config['debug']);
59+
ini_set('error_reporting', $e_all);
60+
ini_set('short_open_tag', 'On');
61+
ini_set('default_charset', "UTF-8");
62+
ini_set('memory_limit', $config['memory_limit']);
63+
ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']);
64+
ini_set('date.timezone', $config['time_zone']);
65+
66+
define ('DEBUG_SQL_LOG', $config['debug_sql']);
67+
define ('DEBUG_TIME_LOG', $config['debug_time']);
68+
define ('DEBUG_CALENDAR_LOG', $config['debug_calendar']);
69+
define ('MEMCACHED_ENABLED', $config['memcached']);
70+
define ('MEMCACHED_SERVER', $config['memcached_server']);
71+
define ('TIME_ZONE', $config['time_zone']);
5372

5473
// trap -V before pake
5574
if (in_array('-v', $argv) || in_array('-V', $argv) || in_array('--version', $argv))
@@ -78,5 +97,3 @@
7897
CLI::run();
7998

8099
exit(0);
81-
82-
?>

workflow/engine/classes/class.system.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,13 +1030,13 @@ public static function getSystemConfiguration($iniFile='')
10301030

10311031
/* Read the env.ini */
10321032
$ini_contents = parse_ini_file($iniFile, false);
1033-
1034-
// validation debug config, ony accept bynary values, 1 to enable
1035-
$ini_contents['debug'] = $ini_contents['debug'] == 1 ? 1 : 0;
10361033

10371034
if ($ini_contents !== false) {
10381035
$config = array_merge($config, $ini_contents);
10391036
}
1037+
1038+
// validation debug config, ony accept bynary values, 1 to enable
1039+
$config['debug'] = $config['debug'] == 1 ? 1 : 0;
10401040

10411041
return $config;
10421042
}

workflow/public_html/sysGeneric.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
ini_set('default_charset', "UTF-8");
6767
ini_set('memory_limit', $config['memory_limit']);
6868
ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']);
69+
ini_set('date.timezone', $config['time_zone']);
6970

7071
define ('DEBUG_SQL_LOG', $config['debug_sql']);
7172
define ('DEBUG_TIME_LOG', $config['debug_time']);

0 commit comments

Comments
 (0)