From e5ecad7eeb035e7579e5cc729b46412188ebb2ae Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 20 Nov 2012 14:45:30 +0100 Subject: [PATCH] Enforce a UTC timezone if none is set to prevent misconfigured php from blowing up, refs #923 --- src/Composer/Console/Application.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 0e036ada7..293c67a60 100755 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -47,12 +47,16 @@ class Application extends BaseApplication public function __construct() { - ErrorHandler::register(); if (function_exists('ini_set')) { ini_set('xdebug.show_exception_trace', false); ini_set('xdebug.scream', false); + + } + if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) { + date_default_timezone_set(@date_default_timezone_get()); } + ErrorHandler::register(); parent::__construct('Composer', Composer::VERSION); }