MDL-22625 workaround for missing default timezone

This commit is contained in:
Petr Skoda 2010-08-29 14:15:17 +00:00
parent 8b2ebe7f03
commit 4ede587e28

View File

@ -46,6 +46,12 @@ if (file_exists($configfile)) {
define('CLI_SCRIPT', false); // prevents some warnings later
define('AJAX_SCRIPT', false); // prevents some warnings later
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this.
if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) {
@date_default_timezone_set(@date_default_timezone_get());
}
// make sure PHP errors are displayed - helps with diagnosing of problems
@error_reporting(E_ALL);
@ini_set('display_errors', '1');