瀏覽代碼

Enforce a UTC timezone if none is set to prevent misconfigured php from blowing up, refs #923

Jordi Boggiano 12 年之前
父節點
當前提交
e5ecad7eeb
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Composer/Console/Application.php

+ 5 - 1
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);
     }