[FEATURE] Add a unique request ID
authorIngo Renner <ingo@typo3.org>
Sat, 14 Jul 2012 14:18:59 +0000 (16:18 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sat, 14 Jul 2012 17:17:09 +0000 (19:17 +0200)
To allow grouping of log records belonging to a certain request,
a unique id per request is needed.

Change-Id: I76e279e3ebe22fa17b1ffdf9a57c037b75680b82
Resolves: #38954
Releases: 6.0
Reviewed-on: http://review.typo3.org/12792
Reviewed-by: Fabien Udriot
Reviewed-by: Wouter Wolters
Reviewed-by: Marcus Schwemer
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
typo3/classes/Bootstrap.php

index 19198ef..0a676c5 100644 (file)
@@ -49,9 +49,17 @@ class Typo3_Bootstrap {
        protected static $instance = NULL;
 
        /**
+        * Unique Request ID
+        *
+        * @var string
+        */
+       protected $requestId;
+
+       /**
         * Disable direct creation of this object.
         */
        protected function __construct() {
+               $this->requestId = uniqid();
        }
 
        /**
@@ -73,6 +81,15 @@ class Typo3_Bootstrap {
        }
 
        /**
+        * Gets the request's unique ID
+        *
+        * @return string Unique request ID
+        */
+       public function getRequestId() {
+               return $this->requestId;
+       }
+
+       /**
         * Prevent any unwanted output that may corrupt AJAX/compression.
         * This does not interfeer with "die()" or "echo"+"exit()" messages!
         *