--- trace/trace.module.ORIGINAL		2009-09-18 17:07:47.000000000 +0200
+++ trace/trace.module			2010-03-08 11:52:16.000000000 +0100
@@ -11,6 +11,14 @@
 //////////////////////////////////////////////////////////////////////////////
 
 /**
+ * A temporary workaround - we have to execute this line to load lock.inc before
+ * the locale module is loaded through drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL)
+ * (according to post http://drupal.org/node/732064#5 - to resolve issue #642592)
+ */
+
+drupal_bootstrap(DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE);
+
+/**
  * Call full bootstrap to make use of path checking & file functions early on.
  * See also: http://api.drupal.org/api/file/includes/path.inc/6
  */
@@ -107,7 +115,7 @@ function trace_boot() {
       if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         trace('debug', '$_GET = '   . trace_format_php($_GET));
       }
-      else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+      elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
         trace('debug', '$_POST = '  . trace_format_php($_POST));
         trace('debug', '$_FILES = ' . trace_format_php($_FILES));
       }
@@ -180,7 +188,7 @@ function _trace_ob_start() {
   }
 
   if (TRACE_REQUEST) {
-    $msg = array($timestamp, $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'], $_SERVER['SERVER_PROTOCOL']);
+    $msg = array($timestamp, $_SERVER['REQUEST_METHOD'], request_uri(), $_SERVER['SERVER_PROTOCOL']);
     trace('request', implode(' ', $msg), 0);
   }
 
@@ -517,7 +525,7 @@ function trace_format_php($value, $depth
       if ($depth > 1) {
         $array = array('...');
       }
-      else if (array_keys($value) === range(0, sizeof($value) - 1)) {
+      elseif (array_keys($value) === range(0, sizeof($value) - 1)) {
         $array = array_map('trace_format_php', array_values($value));
       }
       else {
