Skip to content

Commit

Permalink
[BUGFIX] Update redefinition guard comments in SystemEnvironmentBuilder
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bnf authored and maddy2101 committed Dec 19, 2018
1 parent 20e5c5b commit 850e87f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
Expand Up @@ -109,7 +109,8 @@ protected static function createApplicationContext(): ApplicationContext
*/
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;
}
Expand Down Expand Up @@ -511,7 +512,9 @@ protected static function usesComposerClassLoading(): bool
*/
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);
Expand All @@ -528,7 +531,9 @@ protected static function defineTypo3RequestTypes()
*/
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);
Expand All @@ -541,7 +546,9 @@ protected static function setRequestType(int $requestType)
*/
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);
Expand Down

0 comments on commit 850e87f

Please sign in to comment.