From 34ad2c9722861a5d7cc78b6004bacf6d5ff8a921 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 13 Jun 2012 13:36:57 +0000 Subject: [PATCH] check if date.timezone is set, report it and set something if not, as it gives tons of errors in install log --- setup/setup-cli.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup/setup-cli.php b/setup/setup-cli.php index c8346dc1f9..eb43351957 100755 --- a/setup/setup-cli.php +++ b/setup/setup-cli.php @@ -37,6 +37,14 @@ if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session. { ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir } +// check if date.timezone is set, report it and set something if not, as it gives tons of errors in install log +if (!ini_get('date.timezone')) +{ + if (!($tz = date_default_timezone_get())) $tz = 'UTC'; + echo "No default timezone (php.ini date.timezone) set, we temporary set '$tz'. You should fix that permanent!\n"; + ini_set('date.timezone',$tz); +} + // setting up the $GLOBALS['egw_setup'] object AND including the header.inc.php if it exists include('inc/functions.inc.php'); $GLOBALS['egw_info']['flags']['no_exception_handler'] = 'cli'; // inc/functions.inc.php does NOT set it