[TASK] CGL cleanup in bootstrap
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 16 May 2012 19:30:30 +0000 (21:30 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 16 May 2012 19:34:02 +0000 (21:34 +0200)
Fix some cgl flaws that slipped through during the bootstrap refactoring.

Change-Id: Id2d122d0afdb3e0e1091a13eeecf62c1c67236f4
Resolves: #37236
Releases: 6.0
Reviewed-on: http://review.typo3.org/11261
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
index.php
t3lib/config_default.php
typo3/Bootstrap.php
typo3/install/index.php

index 569bd65..438d5a2 100644 (file)
--- a/index.php
+++ b/index.php
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
  * Basically this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
  *
- * @author     René Fritz <r.fritz@colorcube.de>
+ * @author René Fritz <r.fritz@colorcube.de>
  * @package TYPO3
  * @subpackage tslib
  */
@@ -40,8 +41,5 @@ Typo3_Bootstrap::defineAndCheckPaths('');
 Typo3_Bootstrap::requireBaseClasses();
 Typo3_Bootstrap::setUpEnvironment();
 
-// ******************
-// include TSFE
-// ******************
-require (PATH_tslib . 'index_ts.php');
+require(PATH_tslib . 'index_ts.php');
 ?>
\ No newline at end of file
index d34484f..c39fd99 100644 (file)
@@ -1063,7 +1063,7 @@ if(count($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']) > 0) {
        // Error & Exception handling
 if ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
        if ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {
-                       //      Register an error handler for the given errorHandlerErrors
+                       // Register an error handler for the given errorHandlerErrors
                $errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);
                        // Set errors which will be converted in an exception
                $errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);
index 9a6d2cc..923fbf9 100644 (file)
@@ -222,8 +222,8 @@ class Typo3_Bootstrap {
                        if (TYPO3_PROCEED_IF_NO_USER === 2) {
                                // Ajax poll for login, let it pass
                        } else {
-                               $fileContent = t3lib_div::getUrl(PATH_typo3conf.'LOCK_BACKEND');
-                               if ($fileContent)       {
+                               $fileContent = t3lib_div::getUrl(PATH_typo3conf . 'LOCK_BACKEND');
+                               if ($fileContent) {
                                        header('Location: ' . $fileContent);
                                } else {
                                        throw new RuntimeException(
@@ -270,17 +270,17 @@ class Typo3_Bootstrap {
                        }
                        if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 3) {
                                $requestStr = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT'), strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir));
-                               if($requestStr == 'index.php' && !t3lib_div::getIndpEnv('TYPO3_SSL')) {
+                               if ($requestStr === 'index.php' && !t3lib_div::getIndpEnv('TYPO3_SSL')) {
                                        list(,$url) = explode('://', t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 2);
                                        list($server, $address) = explode('/', $url, 2);
                                        header('Location: https://' . $server . $sslPortSuffix . '/' . $address);
                                        exit;
                                }
-                       } elseif (!t3lib_div::getIndpEnv('TYPO3_SSL') ) {
-                               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 2) {
+                       } elseif (!t3lib_div::getIndpEnv('TYPO3_SSL')) {
+                               if (intval($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL']) === 2) {
                                        list(,$url) = explode('://', t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir, 2);
                                        list($server, $address) = explode('/', $url, 2);
-                                       header('Location: https://'.$server . $sslPortSuffix . '/' . $address);
+                                       header('Location: https://' . $server . $sslPortSuffix . '/' . $address);
                                } else {
                                                // Send Not Found header - if the webserver can make use of it...
                                        header('Status: 404 Not Found');
@@ -351,7 +351,7 @@ class Typo3_Bootstrap {
         * @return void
         */
        public static function initializeBackendUserMounts() {
-                       // ! WILL INCLUDE deleted mount pages as well!
+                       // Includes deleted mount pages as well! @TODO: Figure out why ...
                $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
                $GLOBALS['FILEMOUNTS'] = $GLOBALS['BE_USER']->returnFilemounts();
        }
@@ -374,7 +374,7 @@ class Typo3_Bootstrap {
         */
        protected static function checkPhpVersionOrDie() {
                if (version_compare(phpversion(), '5.3', '<')) {
-                       die ('TYPO3 requires PHP 5.3.0 or higher.');
+                       die('TYPO3 requires PHP 5.3.0 or higher.');
                }
        }
 
index ca79a9a..1d633d8 100755 (executable)
 /**
  * Starter-script for install screen
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 
 ob_start();
 
-define('TYPO3_MODE','BE');
+define('TYPO3_MODE', 'BE');
 define('TYPO3_enterInstallScript', '1');
 
 require('../Bootstrap.php');
@@ -58,7 +58,7 @@ Typo3_Bootstrap::checkBackendIpOrDie();
 Typo3_Bootstrap::checkSslBackendAndRedirectIfNeeded();
 
        // Run install script
-if(!t3lib_extMgm::isLoaded('install')) {
+if (!t3lib_extMgm::isLoaded('install')) {
        die('Install Tool is not loaded as an extension.<br />You must add the key "install" to the list of installed extensions in typo3conf/localconf.php, $TYPO3_CONF_VARS[\'EXT\'][\'extList\'].');
 }