[TASK] Add a comment for require(Bootstrap.php)
authorOliver Klee <typo3-coding@oliverklee.de>
Wed, 23 May 2012 16:53:30 +0000 (18:53 +0200)
committerTolleiv Nietsch <tolleiv.nietsch@typo3.org>
Thu, 24 May 2012 05:21:16 +0000 (07:21 +0200)
Bootstrap.php is included using "require" instead of "require_once" to
create a fatal error if Bootstrap.php is included from another place as
well (which would be a bug).

In order to keep people from changing this to "require_once" (as
recommended by the CGL), there should be comment explaining the
situation.

Change-Id: I39c88cae5af38bceafa5ca92561394a275152520
Resolves: #37447
Relates: #37383
Releases: 6.0
Reviewed-on: http://review.typo3.org/11549
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
index.php
typo3/cli_dispatch.phpsh
typo3/init.php
typo3/install/index.php

index 438d5a2..0774e00 100644 (file)
--- a/index.php
+++ b/index.php
@@ -34,6 +34,8 @@
  * @subpackage tslib
  */
 
+       // We use require instead of require_once here so we get a fatal error if Bootstrap.php is accidentally included twice
+       // (which would indicate a clear bug).
 require('typo3/Bootstrap.php');
 Typo3_Bootstrap::checkEnvironmentOrDie();
 Typo3_Bootstrap::defineBaseConstants();
index 82323f2..9cc1f47 100755 (executable)
@@ -40,6 +40,8 @@
 define('TYPO3_MODE','BE');
 define('TYPO3_cliMode', TRUE);
 
+       // We use require instead of require_once here so we get a fatal error if Bootstrap.php is accidentally included twice
+       // (which would indicate a clear bug).
 require('Bootstrap_Cli.php');
 Typo3_Bootstrap_Cli::checkEnvironmentOrDie();
 
index c51aa29..ae42f8c 100644 (file)
@@ -65,6 +65,8 @@ ob_start();
 // *******************************
 define('TYPO3_MODE','BE');
 
+       // We use require instead of require_once here so we get a fatal error if Bootstrap.php is accidentally included twice
+       // (which would indicate a clear bug).
 require('Bootstrap.php');
 Typo3_Bootstrap::checkEnvironmentOrDie();
 Typo3_Bootstrap::defineBaseConstants();
index 1d633d8..13e047a 100755 (executable)
@@ -37,6 +37,8 @@ ob_start();
 define('TYPO3_MODE', 'BE');
 define('TYPO3_enterInstallScript', '1');
 
+       // We use require instead of require_once here so we get a fatal error if Bootstrap.php is accidentally included twice
+       // (which would indicate a clear bug).
 require('../Bootstrap.php');
 Typo3_Bootstrap::checkEnvironmentOrDie();
 Typo3_Bootstrap::defineBaseConstants();