[BUGFIX] Update redefinition guard comments in SystemEnvironmentBuilder 14/59214/3
authorBenjamin Franzke <bfr@qbus.de>
Wed, 19 Dec 2018 13:45:02 +0000 (14:45 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Dec 2018 15:02:33 +0000 (16:02 +0100)
These constant redefintion guards were forgotten to be updated when
Bootstrap::getInstance() and the call to SystemEnvironmentBuilder::run()
in Bootstrap::baseSetup() were removed.

These guards are no longer necessary for regular execution as baseSetup()
does no longer (conditionally) invoke SystemEnvironmentBuilder::run()
(which was provided for deprecated and now removed bootstrapping code).

We do still leave the guards in, as they are needed in unit tests,
but update the comments.

Releases: master
Resolves: #87216
Related: #87202
Change-Id: I3b1c60ea32163d68b7f314b6539c54d8c048c323
Reviewed-on: https://review.typo3.org/59214
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php

index 46421cb..3144681 100644 (file)
@@ -109,7 +109,8 @@ class SystemEnvironmentBuilder
      */
     protected static function defineBaseConstants()
     {
-        // Check one of the constants and return early if defined already
+        // Check one of the constants and return early if already defined,
+        // needed if multiple requests are handled in one process, for instance in functional testing.
         if (defined('TYPO3_version')) {
             return;
         }
@@ -511,7 +512,9 @@ class SystemEnvironmentBuilder
      */
     protected static function defineTypo3RequestTypes()
     {
-        if (defined('TYPO3_REQUESTTYPE_FE')) { // @todo remove once Bootstrap::getInstance() is dropped
+        // Check one of the constants and return early if already defined,
+        // needed if multiple requests are handled in one process, for instance in functional testing.
+        if (defined('TYPO3_REQUESTTYPE_FE')) {
             return;
         }
         define('TYPO3_REQUESTTYPE_FE', self::REQUESTTYPE_FE);
@@ -528,7 +531,9 @@ class SystemEnvironmentBuilder
      */
     protected static function setRequestType(int $requestType)
     {
-        if (defined('TYPO3_REQUESTTYPE')) { // @todo remove once Bootstrap::getInstance() is dropped
+        // Return early if already defined,
+        // needed if multiple requests are handled in one process, for instance in functional testing.
+        if (defined('TYPO3_REQUESTTYPE')) {
             return;
         }
         define('TYPO3_REQUESTTYPE', $requestType);
@@ -541,7 +546,9 @@ class SystemEnvironmentBuilder
      */
     protected static function defineLegacyConstants(string $mode)
     {
-        if (defined('TYPO3_MODE')) { // @todo remove once Bootstrap::getInstance() is dropped
+        // Return early if already defined,
+        // needed if multiple requests are handled in one process, for instance in functional testing.
+        if (defined('TYPO3_MODE')) {
             return;
         }
         define('TYPO3_MODE', $mode);